Last active
July 12, 2017 20:28
-
-
Save listrophy/0c553fd5842cece036af9331690a1216 to your computer and use it in GitHub Desktop.
Trying to call an Angular Component's method in the template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'my-component', | |
template: ` | |
<my-component [value]="someValue"> | |
<!-- Does not work --> | |
<div>{{aFunctionThatExistsInMyComponent()}}</div> | |
</my-component>` | |
}) | |
export class MyComponent { | |
value: string; | |
aFunctionThatExistsInMyComponent() { | |
return "I wish this worked"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment