AngularJS - json data from view to controller

2019-03-03 00:18发布

问题:

I get my html template + json data from xsl translator , it is dynamic , it looks like html code plus some data in stringified json. The question is: in what way i put the json string in html code , so that controller will catch this json data before html rendering? When i simple put it like this:

<div>{{ $scope.categories = [{},{},...]}}</div>
<div ng-repeat="category in categories" class="category">...</div>

it works good , but brings some strange error:

Error: 10 $digest() iterations reached. Aborting!

So what is the good way to pass data from view to controller?