I am building a page with several dynamic panels, each child panel has the same HTML so I have created a parent panel component to wrap each one.
The problem is I want to send an event from the child to the panel but I cant seem to find an answer. Here's what I have so far:
// Panel Panel Component
@Component({
    selector: 'panel',
    template: `
    <div (emittedEvent)="func($event)">
        <ng-content></ng-content>
    </div>
    `
})
export class PanelComponent {
    constructor() {}
    func(event) {
    // Do stuff with the event
    }
}
// Child Panel Component (one of many)
@Component({
selector: 'child-panel-one',
template: `
    // Template stuff
    <button (click)="emitEvent()">Click</button>
`
})
export class ChildPanelOne {
emittedValue: Boolean = false;
@Output() emittedEvent = new EventEmitter();
constructor() {}
private emitEvent() {
    this.emittedValue = true;
    this.emittedEvent.emit(this.emittedValue)
}
}
//
// Main Parent Template
<panel>
    <child-panel-one></child-panel-one>
</panel>
I could create a shared service but it seems an overkill for passing a boolean value from child to parent.
Any ideas?
Thanks
 
     
     
     
    