Currently utilizing Angular 1.4.7 in conjunction with angular-ui-router 0.2.15
as the state router. The standard controller setup I have is as follows:
var app = angular.module('App.Page1',[....]);
app.controller('Page1Ctrl',['$scope' ... ,function($scope ...) {
...
$scope.records = [];
// jsRoutes.controllers.Page1.list() - serves as ajax wrapper
jsRoutes.controllers.Page1.listitems().ajax({
success: function(data) {
console.log("RECV",data);
$scope.records = data
},
error: function(res){ console.log("ERROR",res); }
});
});
The controller template simply displays the records as follows:
<h1>Page1</h1>
<div ng-repeat="record in records" class="row">
{{record.name}} ...
</div>
Although it functions, there are occasional stability issues. There are times when only the header is displayed on the page. It appears that the parsers array is empty, even though the network requests show that the list request was received successfully and the success function ran. Upon refreshing the page, the data reappears.