0

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 ?

1 Answer 1

2

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>
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a lot that was easy^^ and it s now working :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.