app-root (AppComponent) being parent to sub-book (BookComponent) listens to b event… Angular will subscribe to the propertyChanged event and call the propertyChanged() method with the event data when the child component triggers the emit() method.. That’s cool. Directives typically raise custom events with an Angular EventEmitter as follows. In our case we are emitting a number type: So what’s happening here? In this post you’re going to learn how to reference an element inside an Angular template. Event emitters are made by using Angular's @Output decorators. We tried to emit the event using one of the Angular Component lifecycle hooks (ngOnInit, ngAfterContentInit, ngAfterContentChecked, ngAfterViewInit). The two-way binding in DatePicker can also be achieved using the custom event binding and property binding in the controls present in two different components. @Input defines the input property in the component, which the parent component can set. The main purpose of an EventEmitter in Angular is to create custom events and fire them as per your requirement. A newer version of this site just became available. Applies to: Angular 2 to the latest edition of i.e. Follow the directions in the readme Understanding @Output and EventEmitter in Angular, Developer However, the game does nothing at the moment as these areas don’t talk to each other at all.