I want to use events to handle this task. I tried the method explained in this thread but it did not work. I have the following code:
childComponent.ts:
//Getting parent method (Equipments)
@Output() addCompleted = new EventEmitter<string>();
processComplete() {
this.addCompleted.emit('complete');
}
parentComponent.ts:
onUpdateGrid(e: any){
alert("Works!")
}
parentComponent.html:
<ejs-grid #Grid class="data-grid" (addCompleted)="onUpdateGrid($event)" . . .>
. . . .
</ejs-grid>
The only thing I could not follow from that thread is directives: [ ChildComponent ]
in @Component
because it is deprecated.
When I run the code, the parent method does not run.
Update: Child component decorator:
@Component({
selector: 'app-add-equipment',
templateUrl: './add-equipment.component.html',
styleUrls: ['./add-equipment.component.scss']
})