|
1 | 1 | import { |
2 | 2 | Attribute, ComponentFactory, ComponentRef, Directive, |
3 | | - ReflectiveInjector, ResolvedReflectiveProvider, |
4 | | - ViewRef, ViewContainerRef, |
| 3 | + ReflectiveInjector, ResolvedReflectiveProvider, ViewContainerRef, |
5 | 4 | Inject, ComponentFactoryResolver, Injector |
6 | 5 | } from "@angular/core"; |
7 | 6 | import { isPresent } from "../lang-facade"; |
@@ -62,7 +61,6 @@ export class PageRouterOutlet { // tslint:disable-line:directive-class-suffix |
62 | 61 | private viewUtil: ViewUtil; |
63 | 62 | private refCache: RefCache = new RefCache(); |
64 | 63 | private isInitialPage: boolean = true; |
65 | | - private previousPagesViews: Array<ViewRef> = new Array(); |
66 | 64 | private detachedLoaderFactory: ComponentFactory<DetachedLoader>; |
67 | 65 |
|
68 | 66 | private currentActivatedComp: ComponentRef<any>; |
@@ -154,16 +152,8 @@ export class PageRouterOutlet { // tslint:disable-line:directive-class-suffix |
154 | 152 | this.currentActivatedRoute = activatedRoute; |
155 | 153 |
|
156 | 154 | if (this.locationStrategy._isPageNavigatingBack()) { |
157 | | - if (this.previousPagesViews.length) { |
158 | | - this.containerRef.insert(this.previousPagesViews.pop()); |
159 | | - } |
160 | | - |
161 | 155 | this.activateOnGoBack(activatedRoute, outletMap); |
162 | 156 | } else { |
163 | | - if (this.containerRef.length) { |
164 | | - this.previousPagesViews.push(this.containerRef.detach()); |
165 | | - } |
166 | | - |
167 | 157 | this.activateOnGoForward(activatedRoute, providers, outletMap, resolver, injector); |
168 | 158 | } |
169 | 159 | } |
@@ -206,11 +196,9 @@ export class PageRouterOutlet { // tslint:disable-line:directive-class-suffix |
206 | 196 | [...providers, ...pageResolvedProvider], injector); |
207 | 197 | const loaderRef = this.containerRef.createComponent( |
208 | 198 | this.detachedLoaderFactory, this.containerRef.length, childInjector, []); |
209 | | - |
210 | 199 | loaderRef.changeDetectorRef.detectChanges(); |
211 | 200 |
|
212 | 201 | this.currentActivatedComp = loaderRef.instance.loadWithFactory(factory); |
213 | | - |
214 | 202 | this.currentActivatedComp.changeDetectorRef.detectChanges(); |
215 | 203 |
|
216 | 204 | this.loadComponentInPage(page, this.currentActivatedComp); |
|
0 commit comments