File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -27,15 +27,20 @@ export class UIRouterLocation {
27
27
let locSt = this . locationStrategy ;
28
28
29
29
if ( this . isHashBang ) {
30
+ loc . path = ( ) =>
31
+ splitOnHash ( splitOnQuestionMark ( locSt . path ( ) ) [ 0 ] ) [ 0 ] ;
30
32
loc . hash = ( ) =>
31
33
splitOnHash ( splitOnHash ( this . platformLocation . hash ) [ 1 ] ) [ 1 ] ;
32
34
} else {
35
+ let basepath = locSt . getBaseHref ( ) ;
36
+ let basepathRegExp = new RegExp ( "^" + basepath ) ;
37
+ let replace = ( basepath [ basepath . length - 1 ] === '/' ) ? "/" : "" ;
38
+ loc . path = ( ) =>
39
+ splitOnHash ( splitOnQuestionMark ( locSt . path ( ) ) [ 0 ] ) [ 0 ] . replace ( basepathRegExp , replace ) ;
33
40
loc . hash = ( ) =>
34
41
splitOnHash ( this . platformLocation . hash ) [ 1 ] ;
35
42
}
36
43
37
- loc . path = ( ) =>
38
- splitOnHash ( splitOnQuestionMark ( locSt . path ( ) ) [ 0 ] ) [ 0 ] ;
39
44
40
45
loc . search = ( ) => {
41
46
let queryString = splitOnHash ( splitOnQuestionMark ( locSt . path ( ) ) [ 1 ] ) [ 0 ] ;
You can’t perform that action at this time.
0 commit comments