Altered ui-router definitions
1. Allow trailing slash in urls 2. Use integer ids for detail views as default
This commit is contained in:
parent
d0d01ed71c
commit
f8e18a8900
@ -1,6 +1,9 @@
|
|||||||
angular.module('OpenSlidesApp.core', [])
|
angular.module('OpenSlidesApp.core', [])
|
||||||
|
|
||||||
.config(function($stateProvider) {
|
.config(function($stateProvider, $urlMatcherFactoryProvider) {
|
||||||
|
// Make the trailing slash optional
|
||||||
|
$urlMatcherFactoryProvider.strictMode(false)
|
||||||
|
|
||||||
// Use stateProvider.decorator to give default values to our states
|
// Use stateProvider.decorator to give default values to our states
|
||||||
$stateProvider.decorator('views', function(state, parent) {
|
$stateProvider.decorator('views', function(state, parent) {
|
||||||
var result = {},
|
var result = {},
|
||||||
@ -56,7 +59,9 @@ angular.module('OpenSlidesApp.core', [])
|
|||||||
create: '/new',
|
create: '/new',
|
||||||
update: '/edit',
|
update: '/edit',
|
||||||
list: '',
|
list: '',
|
||||||
detail: '/:id',
|
// The id is expected to be an integer, if not, the url has to
|
||||||
|
// be defined manually
|
||||||
|
detail: '/{id:int}',
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultUrl = defaultUrls[_.last(patterns)];
|
defaultUrl = defaultUrls[_.last(patterns)];
|
||||||
|
Loading…
Reference in New Issue
Block a user