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

Commit

Permalink
Merge pull request #541 from grtjn/531-uri-param
Browse files Browse the repository at this point in the history
Fixed #531: fixed issue with uri state param handling
  • Loading branch information
grtjn authored Dec 4, 2017
2 parents e534e4f + 15be926 commit c883990
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions app/templates/ui/app/route/route.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,6 @@
$urlRouterProvider.otherwise('/');
$locationProvider.html5Mode(true);

function valToFromString(val) {
return val !== null ? val.toString() : val;
}

function regexpMatches(val) { // jshint validthis:true
return this.pattern.test(val);
}

$urlMatcherFactoryProvider.type('path', {
encode: valToFromString,
decode: valToFromString,
is: regexpMatches,
pattern: /.+/
});

$stateProvider
.state('root', {
url: '',
Expand Down Expand Up @@ -120,7 +105,7 @@
}
})
.state('root.edit', {
url: '/edit{uri:path}?prev',
url: '/edit{uri:.*}?prev',
templateUrl: 'app/create/create.html',
controller: 'CreateCtrl',
controllerAs: '$ctrl',
Expand All @@ -134,7 +119,7 @@
}
})
.state('root.view', {
url: '/detail{uri:path}',
url: '/detail{uri:.*}',
params: {
uri: {
value: null
Expand Down

0 comments on commit c883990

Please sign in to comment.