@@ -17,7 +17,7 @@ export class StateRegistry {
17
17
private builder : StateBuilder ;
18
18
stateQueue : StateQueueManager ;
19
19
20
- constructor ( urlMatcherFactory : UrlMatcherFactory , urlRouterProvider , private currentState : ( ) => State ) {
20
+ constructor ( urlMatcherFactory : UrlMatcherFactory , urlRouterProvider ) {
21
21
this . matcher = new StateMatcher ( this . states ) ;
22
22
this . builder = new StateBuilder ( this . matcher , urlMatcherFactory ) ;
23
23
this . stateQueue = new StateQueueManager ( this . states , this . builder , urlRouterProvider ) ;
@@ -44,9 +44,12 @@ export class StateRegistry {
44
44
return this . stateQueue . register ( stateDefinition ) ;
45
45
}
46
46
47
- get ( stateOrName : StateOrName , base : StateOrName ) : ( StateDeclaration | StateDeclaration [ ] ) {
48
- if ( arguments . length === 0 ) return Object . keys ( this . states ) . map ( name => this . states [ name ] . self ) ;
49
- let found = this . matcher . find ( stateOrName , base || this . currentState ( ) ) ;
47
+ get ( ) : StateDeclaration [ ] ;
48
+ get ( stateOrName : StateOrName , base : StateOrName ) : StateDeclaration ;
49
+ get ( stateOrName ?: StateOrName , base ?: StateOrName ) : ( StateDeclaration | StateDeclaration [ ] ) {
50
+ if ( arguments . length === 0 )
51
+ return < StateDeclaration [ ] > Object . keys ( this . states ) . map ( name => this . states [ name ] . self ) ;
52
+ let found = this . matcher . find ( stateOrName , base ) ;
50
53
return found && found . self || null ;
51
54
}
52
55
0 commit comments