Skip to content
This repository was archived by the owner on Oct 5, 2020. It is now read-only.

Commit c883990

Browse files
authored
Merge pull request #541 from grtjn/531-uri-param
Fixed #531: fixed issue with uri state param handling
2 parents e534e4f + 15be926 commit c883990

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

app/templates/ui/app/route/route.config.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,6 @@
4242
$urlRouterProvider.otherwise('/');
4343
$locationProvider.html5Mode(true);
4444

45-
function valToFromString(val) {
46-
return val !== null ? val.toString() : val;
47-
}
48-
49-
function regexpMatches(val) { // jshint validthis:true
50-
return this.pattern.test(val);
51-
}
52-
53-
$urlMatcherFactoryProvider.type('path', {
54-
encode: valToFromString,
55-
decode: valToFromString,
56-
is: regexpMatches,
57-
pattern: /.+/
58-
});
59-
6045
$stateProvider
6146
.state('root', {
6247
url: '',
@@ -120,7 +105,7 @@
120105
}
121106
})
122107
.state('root.edit', {
123-
url: '/edit{uri:path}?prev',
108+
url: '/edit{uri:.*}?prev',
124109
templateUrl: 'app/create/create.html',
125110
controller: 'CreateCtrl',
126111
controllerAs: '$ctrl',
@@ -134,7 +119,7 @@
134119
}
135120
})
136121
.state('root.view', {
137-
url: '/detail{uri:path}',
122+
url: '/detail{uri:.*}',
138123
params: {
139124
uri: {
140125
value: null

0 commit comments

Comments
 (0)