February 2017
Beginner to intermediate
294 pages
6h 9m
English
The delete event can be processed the same way as the update event. We need to assign a click event to the delete button in the child template:
# src/app/report/report-template.html
#...
<button class="btn btn-default btn-xs pull-right" type="button"
(click)="deleteReportTemplate(model)">
<span class="glyphicon glyphicon-remove" aria-hidden="true">
</span>
</button>
#...
Then add the function and the event emitter to process that click in the child:
// src/app/report/report-template.component.ts
//...
export class ReportTemplateComponent {
//...
@Output() onDeleteReportTemplate = new EventEmitter<any>();
deleteReportTemplate(model) {
this.onDeleteReportTemplate.emit(model);
}
}
In the parent template bind a function ...
Read now
Unlock full access