Skip to content

Commit

Permalink
router race condition fix from chuck
Browse files Browse the repository at this point in the history
  • Loading branch information
tbosch committed Apr 27, 2016
1 parent 2dc806f commit 2d85a5c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/angular2/src/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,10 @@ export class Router {
if (componentInstruction.reuse) {
next = this._outlet.reuse(componentInstruction);
} else {
next =
this.deactivate(instruction).then((_) => this._outlet.activate(componentInstruction));
let outlet = this._outlet;
next = this
.deactivate(instruction)
.then((_) => outlet.activate(componentInstruction));
}
if (isPresent(instruction.child)) {
next = next.then((_) => {
Expand Down Expand Up @@ -412,7 +414,8 @@ export class Router {
next = this._childRouter.deactivate(childInstruction);
}
if (isPresent(this._outlet)) {
next = next.then((_) => this._outlet.deactivate(componentInstruction));
let outlet = this._outlet;
next = next.then((_) => outlet.deactivate(componentInstruction));
}

// TODO: handle aux routes
Expand Down

0 comments on commit 2d85a5c

Please sign in to comment.