I have a list consisting of four items, each with its own counter. Whenever we click on an item, the count increases. I am looking to reset the counter value back to zero for all items except the one that was clicked. You can view the demonstration here.
var myApp = angular.module('myApp',[]);
var jsonInfo = {"count":[{"name":"one",count:0} ,{"name":"two",count:0},{"name":"three",count:0} ,{"name":"four",count:0}]}
function MyCtrl($scope) {
$scope.data =jsonInfo;
$scope.count = function (inc) {
inc.count = inc.count + 1
};
}