matth3o matth3o - 1 year ago 186
Dart Question

dart angular2 - function in sub-component

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

Thanks for your help

Van Van
Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download