Spec-Zone.ru › Angular

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

void

Вызывается при создании директивы RouterOutlet

@paramchildNamestring
@paramoutletRouterOutletContract
@returnsvoid

onChildOutletDestroyed

void

Вызывается при уничтожении директивы RouterOutlet. Контекст необходимо сохранить, поскольку точка выхода может быть уничтожена внутри NgIf и создана повторно позднее.

@paramchildNamestring
@returnsvoid

onOutletDeactivated

Map<string, OutletContext>

Вызывается, когда соответствующий маршрут деактивируется во время навигации. Поскольку компонент уничтожается, все дочерние точки выхода также уничтожаются.

@returnsMap<string, OutletContext>

onOutletReAttached

void
@paramcontextsMap<string, OutletContext>
@returnsvoid

getOrCreateContext

OutletContext
@paramchildNamestring
@returnsOutletContext

getContext

OutletContext | null
@paramchildNamestring
@returnsOutletContext | 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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API