I am facing an issue where I have a function name stored in a variable and I am trying to assign that variable to a click event of a button, but it doesn't seem to be working. Can anyone provide assistance with this?
@Component({
selector: 'my-app',
template: `
<div>
<h2>Function name is: {{FunctionName}}</h2>
<input type="button" value="click here" (click) = [FunctionName]()>
</div>
<p>{{value}}</p>
`,
})
export class App {
FunctionName:string;
value: string;
constructor() {
this.FunctionName = 'clickFunction'
}
clickFunction(){
this.value = "button clicked";
}
}
Here is the code