There is an array of objects in $scope. The array values are modified in inputs by user. Then the array should be updated in $scope. The values of the object keys are being updated well (name and sname). But the values that are stored as array members are not being updated (colors).
You can see the $scope data beneath inputs on the demo I linked. Check which values are being updated when typing in inputs. How to get array members being updated in $scope? Refards planker link: http://plnkr.co/edit/EZ0zE68AdiFQYV425nDA?p=preview code: <!DOCTYPE html> <html> <head> <script data-require="angular.js@*" data-semver="1.4.0-beta.4" src="https://code.angularjs.org/1.4.0-beta.4/angular.js"></script> <style> p{margin: 0;} </style> <script> console.clear(); angular.module("myApp", []).controller("myCtrl", function($scope) { $scope.data = [{ name:"Adam", sname:"Jonason", colors:["yellow", "red", "magenta", "green"]}, {name:"Michal", sname:"Smith", colors:["magenta", "black"]}, {name:"Kate", sname:"Kaspersky", colors:["pink", "magenta", "white"]} ]; }); </script> </head> <body ng-app = "myApp" ng-controller = "myCtrl"> <div ng-repeat = "person in data" style="margin: 0 0 22px"> <input ng-model = "person.name"><br> <input ng-model = "person.sname"> <div ng-repeat = "color in person.colors"> <input ng-model = "color" style="font-style:italic; font-weight:bold"> </div> </div> <h3>$scope:</h3> <div ng-repeat = "person in data" style="margin: 0 0 22px"> <p ng-model = "person.name">{{person.name}}</p> <p ng-model = "person.sname">{{person.sname}}</p> <div ng-repeat = "color in person.colors"> <p ng-model = "color" style="font-style:italic; font-weight:bold">{{color}}</p> </div> </div> </body> </html> -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
