I'm trying to bind a function in a parent component into a property on a child component.
This is what I have
@Component({
selector: 'awesome',
templateUrl: 'awesome.html'
})
export class AwesomeComponent {
@Input() callback: Function;
ngOnInit() {
this.callback();//Error, this.callback is not a function, but contains a string value on the fuction call
}
}
This is how i'm using it
<awesome callback="nameOfFuncFromAnotherComponent"></awesome>
but it doesn't seem to work