I am developing my first Angular app and having trouble with string interpolation.
I have a component which contains the following element:
`<span>{{action.getText()}}</span>`
action is of Type Action which has the following method:
getText(): String { return "Test"; }
The variable action is defined correctly since I can access properties via {{}} without a problem. e.g. {{action.title}}
So my question is, is this even possible to access this function and if yes, what am I doing wrong?
You could convert it to a property:
get text(): string { return "Test"; }
Your template becomes:
<span>{{ation.text}}</span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With