Using AngularJS Values in JavaScript Function -


i have function calls code using jcrop api takes in values set aspect ratio. however, need values come data connection i'm using angular. need this:

<img src="sample.jpg" onclick="setaspectratio({{valuetoset}});" /> 

but this error when trying way. if way:

<img src="sample.jpg" ng-click="setaspectratio({{valuetoset}});" /> 

then valuetoset evaluates, can't call way setaspectratio() isn't defined in controller (it's script on page itself). because uses jcrop , didn't want mix jcrop angular controller.

how can accomplish i'm trying here?

you don't need {{}} around variable name. ng-click=setaspectratio(valuetoset) should work.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -