In the app.component.html file
<li routerLinkActive="active current">
<a [routerLink]="['/stats']">
Cluster stats
</a>
</li>
When we route to the DisplayAllStatsComponent, how can we listen for the 'viewdetails' event triggered in the above li or a tag? In the app.module.ts file
{
path:'/stats',
component : DisplayAllStatsComponent
}
In the DisplayAllStatsComponent, when the component is clicked it triggers an event
@Output('viewdetails') viewdetails = new EventEmitter();
// The function below is called here.
callViewDetails(name,alias){
let ev = {
name:name,alias:alias
};
this.viewdetails.emit(ev); // The value is emitted here.
}
Now I need the emitted value in the app.component.html file