I have a sidebar in my app.component. I want to be able to update it from multiple child components. There is a sample here on how to send data from child to parent component:
https://dzone.com/articles/understanding-output-and-eventemitter-in-angular
However the sample binds the parent to a specific child component:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-root',
template: `<app-child></app-child>`
})
export class AppComponent implements OnInit {
ngOnInit() {
}
}
As you can see the template a bound to app-child specific. How can you make a more generic solution so multiple children can send an event to update menus?