Hello I've started studying Angular 2.
Maybe someone could help me with my question about EventEmitter and outputs in Angular 2
I have 3 components.
AppComponent is parent of CountriesListComponent.
CountriesListComponent is parent of CountryInfoComponent
AppComponent -> CountriesListComponent -> CountryInfoComponent
AppComponent has own function to listen when someone clicks on some country.
Template of AppComponent is like this:
@Component({
template: `...
< countries-list (OnCountrySelected)="countryWasClicked($event)" >
< /countries-list >
`
...
})
class AppComponent {
countryWasClicked(country: Country): void
{
}
}
The function OnCountrySelected is the name of output I want to listen. But I can listen it only in next child in CountriesListComponent, can't I?
I want to listen OnCountrySelected in the CountryInfoComponent.
But I don't know if I can send output throught some childs.
Thanks in advance!