@@ -68,10 +68,12 @@ class Router {
6868 .then ((currTree) {
6969 return new _LoadSegments (currTree, this ._prevTree)
7070 .load (this ._routerOutletMap, this ._rootComponent)
71- .then ((_) {
72- this ._prevTree = currTree;
73- this ._location.go (this ._urlSerializer.serialize (this ._urlTree));
74- this ._changes.emit (null );
71+ .then ((updated) {
72+ if (updated) {
73+ this ._prevTree = currTree;
74+ this ._location.go (this ._urlSerializer.serialize (this ._urlTree));
75+ this ._changes.emit (null );
76+ }
7577 });
7678 });
7779 }
@@ -105,7 +107,7 @@ class _LoadSegments {
105107 List <List <Object >> deactivations = [];
106108 bool performMutation = true ;
107109 _LoadSegments (this .currTree, this .prevTree) {}
108- Future load (RouterOutletMap parentOutletMap, Object rootComponent) {
110+ Future < bool > load (RouterOutletMap parentOutletMap, Object rootComponent) {
109111 var prevRoot = isPresent (this .prevTree) ? rootNode (this .prevTree) : null ;
110112 var currRoot = rootNode (this .currTree);
111113 return this
@@ -116,6 +118,7 @@ class _LoadSegments {
116118 this .loadChildSegments (
117119 currRoot, prevRoot, parentOutletMap, [rootComponent]);
118120 }
121+ return res;
119122 });
120123 }
121124
@@ -217,7 +220,7 @@ class _LoadSegments {
217220 }
218221
219222 void unloadOutlet (RouterOutlet outlet, List <Object > components) {
220- if (outlet.isLoaded) {
223+ if (isPresent (outlet) && outlet.isLoaded) {
221224 StringMapWrapper .forEach (outlet.outletMap._outlets,
222225 (v, k) => this .unloadOutlet (v, components));
223226 if (this .performMutation) {
0 commit comments