Pass Function to component angular
https://stackoverflow.com/questions/51727317/angular-6-call-and-pass-a-function-from-parent-to-child-component/51727452
export class PArentComponent {
fn = function() {
console.log('hello');
};
}
<app-child [function]="fn"></app-child>
export class ChildComponent implements OnInit {
@Input() function: any;
ngOnInit() {
this.function();
}
}