@@ -8,6 +8,7 @@ import { RawParams } from "../params/interface";
8
8
import { UrlRule , UrlRuleMatchFn , UrlRuleHandlerFn , UrlRuleType } from "./interface" ;
9
9
import { StateService } from "../state/stateService" ;
10
10
import { UIRouterGlobals } from "../globals" ;
11
+ import { UrlService } from "./urlService" ;
11
12
12
13
/**
13
14
* Creates a [[UrlRule]]
@@ -113,8 +114,8 @@ export class RegExpRule implements UrlRule {
113
114
newurl . replace ( / \$ ( \$ | \d { 1 , 2 } ) / , ( m , what ) =>
114
115
match [ what === '$' ? 0 : Number ( what ) ] ) ;
115
116
116
- match ( path : string ) : RegExpExecArray {
117
- return this . regexp . exec ( path ) ;
117
+ match ( $url : UrlService ) : RegExpExecArray {
118
+ return this . regexp . exec ( $url . path ( ) ) ;
118
119
}
119
120
}
120
121
@@ -168,8 +169,8 @@ export class UrlMatcherRule implements UrlRule {
168
169
( match : RawParams ) =>
169
170
newurl . format ( match ) ;
170
171
171
- match = ( path : string , search : any , hash : string ) =>
172
- this . urlMatcher . exec ( path , search , hash ) ;
172
+ match = ( $url : UrlService ) =>
173
+ this . urlMatcher . exec ( $url . path ( ) , $url . search ( ) , $url . hash ( ) ) ;
173
174
}
174
175
175
176
/**
@@ -193,8 +194,8 @@ export class StateUrlRule implements UrlRule {
193
194
this . $state = router . stateService ;
194
195
}
195
196
196
- match = ( path : string , search : any , hash : string ) =>
197
- this . state . url . exec ( path , search , hash ) ;
197
+ match = ( $url : UrlService ) =>
198
+ this . state . url . exec ( $url . path ( ) , $url . search ( ) , $url . hash ( ) ) ;
198
199
199
200
/**
200
201
* Checks if the router should start a new transition.
@@ -210,7 +211,6 @@ export class StateUrlRule implements UrlRule {
210
211
if ( this . shouldTransition ( match ) ) {
211
212
this . $state . transitionTo ( this . state , match , { inherit : true , source : "url" } ) ;
212
213
}
213
- return true ;
214
214
} ;
215
215
}
216
216
0 commit comments