refactor(router): move setting reuse flag from RouterOutlet to Router
This commit is contained in:
parent
7de447e4b5
commit
ad16e9d910
@ -253,6 +253,7 @@ export class Router {
|
|||||||
}
|
}
|
||||||
return this._outlet.canReuse(instruction.component)
|
return this._outlet.canReuse(instruction.component)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
|
instruction.component.reuse = result;
|
||||||
if (isPresent(this._childRouter) && isPresent(instruction.child)) {
|
if (isPresent(this._childRouter) && isPresent(instruction.child)) {
|
||||||
return this._childRouter._canReuse(instruction.child);
|
return this._childRouter._canReuse(instruction.child);
|
||||||
}
|
}
|
||||||
|
@ -120,10 +120,6 @@ export class RouterOutlet {
|
|||||||
(isPresent(nextInstruction.params) && isPresent(this._currentInstruction.params) &&
|
(isPresent(nextInstruction.params) && isPresent(this._currentInstruction.params) &&
|
||||||
StringMapWrapper.equals(nextInstruction.params, this._currentInstruction.params));
|
StringMapWrapper.equals(nextInstruction.params, this._currentInstruction.params));
|
||||||
}
|
}
|
||||||
return PromiseWrapper.resolve(result).then((result) => {
|
return PromiseWrapper.resolve(result);
|
||||||
// TODO: this is a hack
|
|
||||||
nextInstruction.reuse = result;
|
|
||||||
return result;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user