Revert "feat(router): add reuse support for angular 1.x router"
This reverts commit ddb62feae6
.
This commit is contained in:
12
modules/angular1_router/src/ng_outlet.js
vendored
12
modules/angular1_router/src/ng_outlet.js
vendored
@ -134,14 +134,11 @@ function ngOutletDirective($animate, $injector, $q, $router, $componentMapper, $
|
||||
|
||||
router.registerOutlet({
|
||||
commit: function (instruction) {
|
||||
var next = $q.when(true);
|
||||
var next;
|
||||
var componentInstruction = instruction.component;
|
||||
if (componentInstruction.reuse) {
|
||||
var previousInstruction = currentInstruction;
|
||||
currentInstruction = componentInstruction;
|
||||
if (currentController.onReuse) {
|
||||
next = $q.when(currentController.onReuse(currentInstruction, previousInstruction));
|
||||
}
|
||||
// todo(shahata): lifecycle - onReuse
|
||||
next = $q.when(true);
|
||||
} else {
|
||||
var self = this;
|
||||
next = this.deactivate(instruction).then(function () {
|
||||
@ -162,9 +159,8 @@ function ngOutletDirective($animate, $injector, $q, $router, $componentMapper, $
|
||||
if (!currentInstruction ||
|
||||
currentInstruction.componentType !== componentInstruction.componentType) {
|
||||
result = false;
|
||||
} else if (currentController.canReuse) {
|
||||
result = currentController.canReuse(componentInstruction, currentInstruction);
|
||||
} else {
|
||||
// todo(shahata): lifecycle - canReuse
|
||||
result = componentInstruction === currentInstruction ||
|
||||
angular.equals(componentInstruction.params, currentInstruction.params);
|
||||
}
|
||||
|
Reference in New Issue
Block a user