Reputation: 449
I m new in angular.Here is my code :
home.html :
<div ng-repeat="data in datab track by $index">
<ul class="list">
<li class="item" ng-click="singlegolf(la)" ng-model="la">{{data.href}}</li>
</ul>
</div>
And i would like in my console log to display the value of {{data.href}} in my console So i try that in my controller :
$scope.singlegolf = function(la){
console.log(la)
}
But this is not working can someone help me pls ?
Upvotes: 0
Views: 755
Reputation: 190943
Adjust your template:
<div ng-repeat="data in datab track by $index">
<ul class="list">
<li class="item" ng-click="singlegolf(data.href)" ng-model="la">{{data.href}}</li>
</ul>
</div>
Upvotes: 2