Note
|
This repository is no longer maintained. The story continues at Angular Composition API. |
Reactivity system for Angular. Based on Vue Composition API.
📝 API Reference ⚡ StackBlitz ⭐ Changelog
Note
|
Looking for the previous (9.0.x) docs? Click here. |
@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 install ng-effects