refactor(router): move setting reuse flag from RouterOutlet to Router

This commit is contained in:
Brian Ford 2015-08-30 20:37:23 -07:00
parent 7de447e4b5
commit ad16e9d910
2 changed files with 2 additions and 5 deletions

View File

@ -253,6 +253,7 @@ export class Router {
}
return this._outlet.canReuse(instruction.component)
.then((result) => {
instruction.component.reuse = result;
if (isPresent(this._childRouter) && isPresent(instruction.child)) {
return this._childRouter._canReuse(instruction.child);
}

View File

@ -120,10 +120,6 @@ export class RouterOutlet {
(isPresent(nextInstruction.params) && isPresent(this._currentInstruction.params) &&
StringMapWrapper.equals(nextInstruction.params, this._currentInstruction.params));
}
return PromiseWrapper.resolve(result).then((result) => {
// TODO: this is a hack
nextInstruction.reuse = result;
return result;
});
return PromiseWrapper.resolve(result);
}
}