Change A Value Inside Ng-repeat Cycle With Ng-click
I want to change a value of an item inside an ng-repeat cycle using a function. This for example won't work. HTML
- Copy
Extended
Also keep in mind while using
this
keyword inside a controller factory function. You should assignthis
variable to some variable to ensure thatthis
which you are using is not otherthis
, look atthis
context related issue.angular.module('todoApp', []) .controller('TodoListController', function() { var toList = this; toList.todos = [{name:'test 1'},{name:'test 2'}]; toList.example = function(v) { v.name = 'ora bene'; }; });
Post a Comment for "Change A Value Inside Ng-repeat Cycle With Ng-click"