I created this script to show my problem ...
http://jsfiddle.net/dQDtw/
I pass the newly created array to the directive and everything works fine. However, I get an error in the console window:
Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Any thoughts on what I need for massage to cleanse this? I would like to be able to reuse the directive without having to update the controller.
Here is the html
<body ng-app="myApp"> <test-dir fam-people='[1,4,6]'> </test-dir> <test-dir fam-people='[2,1,0]'> </test-dir> </body>
Here is the JS.
var myApp = angular.module ('myApp', []);
myApp.directive('testDir', function() { return { restrict: 'E' , scope: { famPeople: '=famPeople' } , template: "<ol> <li ng-repeat='p in famPeople'> {{p}}" }; });
angularjs angularjs-directive
Rob G Dec 28 '13 at 5:55 2013-12-28 05:55
source share