Answer the question
In order to leave comments, you need to log in
How to setup ui router?
How to set up transitions in ui route so that only certain values can be set for course, for example 1, 2, 3 , and all others are not?
.state('home.listgroup', {
url: ':course/:grouplist',
templateUrl: 'templates/listgroup.php',
controller: 'listGroupCtrl'
})
Answer the question
In order to leave comments, you need to log in
1. option - regexp, for example:
.state('home.listgroup', {
url: ':course/{grouplist:[1-3]}',
templateUrl: 'templates/listgroup.php',
controller: 'listGroupCtrl'
})
.state('home.listgroup', {
url: ':course/:grouplist',
templateUrl: 'templates/listgroup.php',
controller: 'listGroupCtrl',
resolve: ['$q', '$stateParams', function($q) {
if ($stateParams.grouplist > 3) {
return $q.reject();
}
})];
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question