0

I do not manage to call a function within the template of a subcomponent :

For instance, the following doesn't work :

<button onclick="{{myFunction()}}">

Nothing is displayed, I have the error : Could not find asset MyOuterComponent.dart.js

1 Answer 1

2

Wrapping something with curly braces {{}} is an expression. It is meant for printing a value. What you are trying to do is calling a function. SO just remove the curly braces and assign it with ng-click e.g:

<button (click)="myFunction()">Save</button>

Hope this helps

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for your time. It doesn't work. Are you sure it can be done this way in the dart version of angular2 ?
You are correct it won't work in dart. I will update the answer. My bad

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.