ng effects
1.0.0
Catatan | Repositori ini tidak lagi dipertahankan. Cerita berlanjut di Angular Composition API. |
Sistem reaktivitas untuk sudut. Berdasarkan API komposisi VUE.
Referensi API ⚡ Stackblitz Changelog
Catatan | Mencari dokumen sebelumnya (9.0.x)? Klik disini. |
@ Component ( {
selector : "app-root" ,
inputs : [ "count" ] ,
outputs : [ "countChange" ]
} )
export class AppComponent extends defineComponent ( ( ) => {
const count = ref ( 0 )
const countChange = new EventEmitter < number > ( )
function increment ( ) {
count . value += 1
}
watchEffect ( ( ) => {
countChange . emit ( count . value )
} )
return {
count ,
countChange ,
increment ,
}
} ) { } Instal melalui NPM
npm install ng-effects