ChildrenOutletContexts
Class
stable
Store contextual information about the children (= nested) 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
voidCalled when a RouterOutlet directive is destroyed.
We need to keep the context as the outlet could be destroyed inside a NgIf and might be
re-created later.
@paramchildName
string@returns
voidonOutletDeactivated
Map<string, OutletContext>Called when the corresponding route is deactivated during navigation. Because the component get destroyed, all children outlet are destroyed.
@returns
Map<string, OutletContext>onOutletReAttached
void@returns
voidgetOrCreateContext
OutletContext@paramchildName
string@returns
OutletContextgetContext
OutletContext | null@paramchildName
string@returns
OutletContext | nullJump to details