app.controller("mainController",function($scope){
$scope.taskNames = ['a','b','c','d'];
$scope.showName = function(name){
console.log(name);
}
})
HTML:部分
<p ng-controller="mainController">
<ul>
<li ng-repeat='taskName in taskNames' ng-click='showName({{taskName}})'> //这里我是想获取taskName的值的,但是获取不到,那么我能通过什么方式能获取到taskName上的值呢?
</ul>
</p>
Directement
showName(taskName)
plus besoin de lier, il sera automatiquement analysé en ng-click