The problem I have encountered is that the template is loaded earlier than the parameters in the controller and so the user sees empty blocks.
Controller:
app.controller('mainDashboardApi', ['$scope', '$http',
function($scope, $http) {
$http.get('api/dashboard/main').success(function(data) {
$scope.dashboard = data;
});
}
]);
Router:
$stateProvider
.state('dashboard', {
url: "/dashboard",
templateUrl: "dashboard",
controller: 'mainDashboardApi'
})
How can I make the template load after the parameters finish loading?