onchange event emitter angular to angularjs code example
Example 1: output events in angular with asynchronous
content_copy
<zippy (open)="onOpen($event)" (close)="onClose($event)"></zippy>
Example 2: use of eventemitter in angular
@Component({
selector : 'child',
template : `
<button (click)="sendNotification()">Notify my parent!</button>
`
})
class Child {
@Output() notifyParent: EventEmitter<any> = new EventEmitter();
sendNotification() {
this.notifyParent.emit('Some value to send to the parent');
}
}
@Component({
selector : 'parent',
template : `
<child (notifyParent)="getNotification($event)"></child>
`
})
class Parent {
getNotification(evt) {
}
}