I'm trying to fetch data (units) for a route (app.units). Here's the code.
.state('app.units', {
url: '/units',
views: {
'menuContent' :{
templateUrl: "templates/units.html",
controller: 'UnitCtrl',
resolve:{
units: function($stateParams, ExamService, $rootScope, $http){
return $http.get(ApiEndpoint.url +'/units.json?auth_token='+$rootScope.globals.currentUser.userToken)
.success(function(response){
//console.log('hello');
return response.data;
})
}
}
}
}
})
As you can see this won't resolve, doesn't show any errors in the console and gives me a blank page in my ionic app, yet the endpoint works with Advanced Rest Client for chrome. I've been stuck on this for age could someone please figure this out.