I am using Angular 1.4.7 with angular-ui-router 0.2.15 as state router. My standard controller looks like:
var app = angular.module('App.Page1',[....]);
app.controller('Page1Ctrl',['$scope' ... ,function($scope ...) {
...
$scope.records = [];
// jsRoutes.controllers.Page1.list() - is ajax wrapper
jsRoutes.controllers.Page1.listitems().ajax({
success: function(data) {
console.log("RECV",data);
$scope.records = data
},
error: function(res){ console.log("ERROR",res); }
});
});
And controller template that just rolls out records:
<h1>Page1</h1>
<div ng-repeat="record in records" class="row">
{{record.name}} ...
</div>
It works but not stable. Sometimes I am receiving a page only with the header. Looks like parsers array is empty but I see in Network requests that list request was successfully received and success function was called. After refreshing a page, I see my data again.