Although I'm using the "::" prefix in my Angular 1.3 code, I see a very lengthy error message in the Chrome console that starts with this: Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Note: the SVG graphics are rendered after about 10 seconds or so, but it would be nice to suppress the very lengthy error message that appears in the console, which might also reduce the rendering time.
The code is included below...suggestions are welcome:)
svg-angular.html:
<html ng-app="App">
<head>
<meta chartset="utf-8">
<title>SVG and Angular</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0/angular.js"></script>
<script src="svg-angular.js"></script>
</head>
<body>
<div ng-controller="MyCtrl">
<svg width="800" height="500">
<circle once-bind ng-repeat="p in getElems()"
ng-attr-cx="{{::p.cx}}" ng-attr-cy="{{::p.cy}}"
ng-attr-fill="{{::p.fill}}" ng-attr-r="{{::p.r}}" >
</circle>
</svg>
</div>
</body>
</html>
================
svg-angular.js:
window.App = angular.module('App', []);
App.controller('MyCtrl', function($scope){
$scope.getElems = function(){
var radius=20, maxCount=200, elems=[];
var colors = ["#f00", "#0f0", "#00f"];
for (var i=0; i<maxCount; i++) {
elems.push({cx:i, cy:i, r:radius, fill:colors[i%colors.length]});
}
return elems;
};
});
================