Skip to content

Commit ad16e9d

Browse files
committed
refactor(router): move setting reuse flag from RouterOutlet to Router
1 parent 7de447e commit ad16e9d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

modules/angular2/src/router/router.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ export class Router {
253253
}
254254
return this._outlet.canReuse(instruction.component)
255255
.then((result) => {
256+
instruction.component.reuse = result;
256257
if (isPresent(this._childRouter) && isPresent(instruction.child)) {
257258
return this._childRouter._canReuse(instruction.child);
258259
}

modules/angular2/src/router/router_outlet.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ export class RouterOutlet {
120120
(isPresent(nextInstruction.params) && isPresent(this._currentInstruction.params) &&
121121
StringMapWrapper.equals(nextInstruction.params, this._currentInstruction.params));
122122
}
123-
return PromiseWrapper.resolve(result).then((result) => {
124-
// TODO: this is a hack
125-
nextInstruction.reuse = result;
126-
return result;
127-
});
123+
return PromiseWrapper.resolve(result);
128124
}
129125
}

0 commit comments

Comments
 (0)