ChildrenOutletContexts
Хранит контекстную информацию о дочерних (вложенных) RouterOutlet
API
class ChildrenOutletContexts {
onChildOutletCreated(childName: string, outlet: RouterOutletContract): void;
onChildOutletDestroyed(childName: string): void;
onOutletDeactivated(): Map<string, OutletContext>;
onOutletReAttached(contexts: Map<string, OutletContext>): void;
getOrCreateContext(childName: string): OutletContext;
getContext(childName: string): OutletContext | null;
}
onChildOutletCreated
voidonChildOutletDestroyed
voidВызывается при уничтожении директивы RouterOutlet. Контекст необходимо сохранить, поскольку точка выхода может быть уничтожена внутри NgIf и создана повторно позднее.
@paramchildName
string
@returns
void
onOutletDeactivated
Map<string, OutletContext>Вызывается, когда соответствующий маршрут деактивируется во время навигации. Поскольку компонент уничтожается, все дочерние точки выхода также уничтожаются.
@returns
Map<string, OutletContext>
onOutletReAttached
void
@returns
void
getOrCreateContext
OutletContext
@paramchildName
string
@returns
OutletContext
getContext
OutletContext | null
@paramchildName
string
@returns
OutletContext | null
Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/router/ChildrenOutletContexts