May 2018
Intermediate to advanced
512 pages
11h 3m
English
Your child component should be completely unaware of its parent. This is key to creating reusable components.
We can implement the communication between the city search component and the current weather component leveraging app component as a parent element and let the app module controller orchestrate the data.
Let's see how this implementation will look:
src/app/city-search/city-search.component.tsimport { Component, Output, EventEmitter } from '@angular/core'export class CitySearchComponent implements OnInit { ... @Output() searchEvent = new EventEmitter<string>() ... this.search.valueChanges.debounceTime(1000).subscribe((searchValue: ...Read now
Unlock full access