Imagine this Host Component code:
@Component({
directives: [nestedComponentDirective]
})
export class ParentComponent {
save():void {
this.myService.myHTTPCall().subscribe((event) => {
// if callback successfull we need to let directive know
})
}
Now the Nested Component:
@Component({
selector: 'someSelector',
template: `
<div>
<button [stuff]="stuff"</button>
</div>`
})
export class ContinuationCheckDirective {
@Input() waitingForHostedComp(value) {
console.log ("value", value)
}
How to call waitingForHostedComp from the Host-Component (Parent)?
save()andwaitingForHostComp()?save()is on ParentComponent importing the ChildComponent.waitingForHostComp()is on ChildComponent. Basically what I want is a listener on the ChildComponent that gets triggered when the ParentComponent (which injects the ChildComponent) gets an answer from the server.