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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -