Is it possible to "stop" the state building based on a resolver result? For example, I have the following code:
/**
* @author v.lugovsky
* created on 16.12.2015
*/
(function() {
'use strict';
angular.module('BlurAdmin.pages.dashboard', [])
.config(routeConfig);
/** @ngInject */
function routeConfig($stateProvider) {
$stateProvider
.state('dashboard', {
resolve: {
user: function(baSidebarService){
if(baSidebarService.getStorage()){
return
}
}
},
// if baSidebarService.getStorage() == true
url: '/dashboard',
templateUrl: 'app/pages/dashboard/dashboard.html',
title: 'Dashboard',
sidebarMeta: {
icon: 'ion-android-home',
order: 0,
},
});
}
})();
I would like it to resolve down, if true return was not mounted, ie, would hide the menu item, navigation, icon, etc.