I'm fairly new to angular, so sorry for the newbish question, but I'm totally stumped.
I am trying to preload my controller with data when the route changes using using resolve. I am getting data back from the server, and I'm injecting the resolve object into the controller, but something isn't working.
Here is the resolve portion of the ui-router
resolve: {
categoryList: function ($http) {
$http.get('cfc/category.cfc?method=getCategories')
.success(function (data) {
return data;
});
}
},...
and the controller
app.controller('CategoryController', ['$scope', '$http', 'categoryList',
function ($scope, $http, categoryList) {...
Could someone explain what I'm doing wrong?