@@ -45,12 +45,13 @@ function _constructSegment(componentResolver: ComponentResolver,
4545 matched : _MatchResult ) : Promise < TreeNode < RouteSegment > [ ] > {
4646 return componentResolver . resolveComponent ( matched . route . component )
4747 . then ( factory => {
48+ let urlOutlet = matched . consumedUrlSegments [ 0 ] . outlet ;
4849 let segment = new RouteSegment ( matched . consumedUrlSegments , matched . parameters ,
49- matched . consumedUrlSegments [ 0 ] . outlet ,
50+ isBlank ( urlOutlet ) ? DEFAULT_OUTLET_NAME : urlOutlet ,
5051 matched . route . component , factory ) ;
5152
52- if ( isPresent ( matched . leftOverUrl ) ) {
53- return _recognize ( componentResolver , matched . route . component , matched . leftOverUrl )
53+ if ( matched . leftOverUrl . length > 0 ) {
54+ return _recognizeMany ( componentResolver , matched . route . component , matched . leftOverUrl )
5455 . then ( children => [ new TreeNode < RouteSegment > ( segment , children ) ] ) ;
5556 } else {
5657 return [ new TreeNode < RouteSegment > ( segment , [ ] ) ] ;
@@ -78,12 +79,13 @@ function _matchWithParts(route: RouteMetadata, url: TreeNode<UrlSegment>): _Matc
7879
7980 let current = url ;
8081 for ( let i = 0 ; i < parts . length ; ++ i ) {
82+ if ( isBlank ( current ) ) return null ;
83+
8184 let p = parts [ i ] ;
8285 let isLastSegment = i === parts . length - 1 ;
8386 let isLastParent = i === parts . length - 2 ;
8487 let isPosParam = p . startsWith ( ":" ) ;
8588
86- if ( isBlank ( current ) ) return null ;
8789 if ( ! isPosParam && p != current . value . segment ) return null ;
8890 if ( isLastSegment ) {
8991 lastSegment = current ;
@@ -101,10 +103,18 @@ function _matchWithParts(route: RouteMetadata, url: TreeNode<UrlSegment>): _Matc
101103 current = ListWrapper . first ( current . children ) ;
102104 }
103105
104- let parameters = < { [ key : string ] : string } > StringMapWrapper . merge ( lastSegment . value . parameters ,
105- positionalParams ) ;
106+ if ( isPresent ( current ) && isBlank ( current . value . segment ) ) {
107+ lastParent = lastSegment ;
108+ lastSegment = current ;
109+ }
110+
111+ let p = lastSegment . value . parameters ;
112+ let parameters =
113+ < { [ key : string ] : string } > StringMapWrapper . merge ( isBlank ( p ) ? { } : p , positionalParams ) ;
106114 let axuUrlSubtrees = isPresent ( lastParent ) ? lastParent . children . slice ( 1 ) : [ ] ;
107- return new _MatchResult ( route , consumedUrlSegments , parameters , current , axuUrlSubtrees ) ;
115+
116+ return new _MatchResult ( route , consumedUrlSegments , parameters , lastSegment . children ,
117+ axuUrlSubtrees ) ;
108118}
109119
110120function _checkOutletNameUniqueness ( nodes : TreeNode < RouteSegment > [ ] ) : TreeNode < RouteSegment > [ ] {
@@ -123,8 +133,8 @@ function _checkOutletNameUniqueness(nodes: TreeNode<RouteSegment>[]): TreeNode<R
123133
124134class _MatchResult {
125135 constructor ( public route : RouteMetadata , public consumedUrlSegments : UrlSegment [ ] ,
126- public parameters : { [ key : string ] : string } , public leftOverUrl : TreeNode < UrlSegment > ,
127- public aux : TreeNode < UrlSegment > [ ] ) { }
136+ public parameters : { [ key : string ] : string } ,
137+ public leftOverUrl : TreeNode < UrlSegment > [ ] , public aux : TreeNode < UrlSegment > [ ] ) { }
128138}
129139
130140function _readMetadata ( componentType : Type ) {
0 commit comments