I am following the docs for ng-token-auth here trying to add a resolver for auth, which calls validateUser. When I add this block of code from the documentation I render a blank screen. I get no errors on my rails server console and none in the javascript console in Chrome. Any idea why this would be happening?
Here's my app.js file where the code in question is the resolve block for the "home" state.
sparkleApp = angular.module("sparkleApp",
['templates',
'validation.match',
'ui.bootstrap',
'ngSanitize',
'ui.router',
'LocalStorageModule',
'pippTimelineDirectives',
'ng-token-auth',
'sparkleControllers',
'sparkleServices']);
/* Controllers */
var sparkleControllers = angular.module('sparkleControllers', []);
/* Services */
var sparkleServices = angular.module('sparkleServices', []);
sparkleApp.config(['$stateProvider', '$urlRouterProvider',
function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/');
// HOME STATES AND NESTED VIEWS ========================================
$stateProvider.state('home', {
url: '/',
views: {
// the main template will be placed here (relatively named)
'': {
templateUrl: 'tplHomeView.html',
controller: 'HomeCtrl'
},
'homeJumbotron@home': {
templateUrl: '_tplJumbotron.html'
},
'sparkleForm@home': {
templateUrl: '_tplMessageForm.html'
},
'sparkleFeatured@home': {
templateUrl: '_tplSparkleQuotes.html'
}
},
resolve: {
auth: function($auth) {
return $auth.validateUser();
}
}
})
}])
.config(function($authProvider) {
$authProvider.configure({
apiUrl: '/api/v1'
});
});