encountered a problem with angular development. The framework tinyUi used by
provides a spinner component that needs to be initialized with a set of parameters. Html may look like this
<cti-spinner ng-repeat="item in list" id="options.id" name="options.name" onChange="options.change">
</cti-spinner>
js looks like this
$scope.list= [{
id:1,
name: "tom",
change:function (event,value){
// id
// function(id);
}
}];
I need to pass a parameter id (incrementing) to the callback function change of the spinner component, and $scope.list will change dynamically.
so I use a variable index to save the id value, and use indexPP
every time I push into $scope.list. $scope.list= [{
id:1,
name: "tom",
change:function (event,value){
function($scope.index);
}
}];
// $scope.list.push(new_item)
// $scope.index PP;
but I quickly realized the problem. Change is always executed with the value after the last PP. I would like to ask you guys, is there any way I can send id to change?