angularjs - ngRepeat seems to use a random order instead of order given -
i have json containing objects originating symfony controller.
i need loop on objects so
<li data-ng-repeat="course in courses"></li>
in app controller this
$scope.courses = {{ courses | serialize('json', serialization_context().setgroups(['identification', 'courselisting', 'portaloverview'])) | raw }};
the order okay when check scope variable 'courses' ng-inspect browser plugin.
screenshot : http://i.imgur.com/pky00uo.png
but still loop seems kinda random. lastly object keeps getting placed after 2nd child.
any ideas? need more info, ask. thanks!
okay, seems angular doesn't handle objects when given ng-repeat. transformed object of objects array of objects , objects rendered in right order.
var arrcourses = []; $.each($scope.courses, function(index, obj){ arrcourses.push(obj); }); $scope.courses = arrcourses;
angularjs symfony2
No comments:
Post a Comment