ng effects
1.0.0
Примечание | Этот репозиторий больше не поддерживается. История продолжается в API Angular Composition API. |
Система реактивности для угловой. На основе Vue Composition API.
Ссылка API ⚡ Stackblitz Changelog
Примечание | Ищете предыдущие (9.0.x.x) документы? Кликните сюда. |
@ 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 ,
}
} ) { } Установите через NPM
npm install ng-effects