Answer the question
In order to leave comments, you need to log in
How to pass parameter to stateProvider?
myApp.config(function($stateProvider, $urlRouterProvider, $locationProvider, authorizedchek) {
.state('panel', {
url: '/panel',
templateUrl: 'templates/panel.php',
controller: 'panelCtrl'
})
.state('panel.admin', {
url: '/admin',
controller: 'adminCtrl',
data: {},
templateUrl: function(){
if (param == true){
return 'templates/admin.php'
}
}
})
});
Answer the question
In order to leave comments, you need to log in
All parameters are available through $state, data is in $state.current.data, params can be found in $state.params or $stateParams.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question