yaboiduke yaboiduke - 1 year ago 91
AngularJS Question

AngularJS: Pass binding in ng-click directive

I've called a function on the

event from my html but would like to pass the output of an
as a parameter to that function. INthis case
is the output of the

ng-click = "urlSetter({{item.url}})"

Within the
of the page I have created the relevent function and set it in the

$scope.urlSetter = function(url){

How can I pass the binding to the function?

Answer Source

Don't use interpolation ({{}}) inside ng-click directive.

ng-click = "urlSetter(item.url)"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download