octicon-rss(16/)
You've already forked ionic-framework
mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 22:44:13 +08:00
fix(angular): fix sibling router-outlets (#16774)
fixes #16411
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
committed by
GitHub
gitea-unlock(16/)
parent
b5efedeb1c
commit
35e3848d96
octicon-diff(16/tw-mr-1) 14 changed files with 113 additions and 5 deletions
@@ -62,13 +62,11 @@ export class IonRouterOutlet implements OnDestroy, OnInit {
|
||||
this.name = name || PRIMARY_OUTLET;
|
||||
this.tabsPrefix = tabs === 'true' ? getUrl(router, activatedRoute) : undefined;
|
||||
this.stackCtrl = new StackController(this.tabsPrefix, this.nativeEl, router, navCtrl, zone);
|
||||
|
||||
parentContexts.onChildOutletCreated(this.name, this as any);
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
console.log('router-outlet destroyed');
|
||||
this.parentContexts.onChildOutletDestroyed(this.name);
|
||||
this.stackCtrl.destroy();
|
||||
}
|
||||
|
||||
getContext(): OutletContext | null {
|
||||
|
||||
@@ -94,6 +94,13 @@ export class StackController {
|
||||
return this.activeView ? this.activeView.stackId : undefined;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this.containerEl = undefined!;
|
||||
this.views.forEach(destroyView);
|
||||
this.activeView = undefined;
|
||||
this.views = [];
|
||||
}
|
||||
|
||||
private getStack(stackId: string | undefined) {
|
||||
return this.views.filter(v => v.stackId === stackId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user