如何使用括号将参数传递给角度js函数。

时间:2022-12-08 19:53:08

I want to do something like this:

我想做这样的事情:

<a ng-click="doSomething({{value}})" >

js

JS

$scope.doSomething = function(a){
 console.log(a);
}

1 个解决方案

#1


56  

all you need to do is this:

你需要做的就是:

<a ng-click="doSomething(value)" >

#1


56  

all you need to do is this:

你需要做的就是:

<a ng-click="doSomething(value)" >