Id selected in Angularjs ng-repeat -


i have angularjs code in navigate through collection of values :

<ul class="bullet-list" ng-repeat="item in data track item.id" >     <li><a ng-mouseover="selectedid()" ng-model="item.id" href="{{item.url}}">      {{item.software}}</a></li> </ul> 

in controller code :

$scope.selectedid = function(){     alert($scope.item.id); }; 

but there's error when runs : $scope.item undefined

could guys me ?

do:

ng-mouseover="selectedid(item)" 

and then:

$scope.selectedid = function(item){   alert(item.id); }; 

this pass $scope.item $scope.selectedid function since item bound scope. changes make item inside of function therefore reflected in view.


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -