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?
$http
? – Iļja Gubins May 23 at 10:00$routeProvider.when('/categories', { templateUrl: 'retrieve_xml.php?Xsl=categories.xsl', controller: 'CategoriesCtrl' })
– Cherniv May 23 at 10:07CategoriesCtrl
? What is<div>{{ $scope.categories = [{},{},...]}}</div>
for? – sh0ber May 23 at 15:32$http.get(retrieve_xml.php?Xsl=categories.xsl).success(function (result) { $scope.categories = result; }
. This way categories variable will have all the data it got from your .xml file and then it can properly render html. – Iļja Gubins May 24 at 6:58