ChildrenOutletContexts
From Get docs
< @angular/routerAngular/docs/8/api/router/childrenoutletcontexts
ChildrenOutletContexts
class
Store contextual information about the children (= nested) RouterOutlet
class ChildrenOutletContexts {
onChildOutletCreated(childName: string, outlet: RouterOutlet): void
onChildOutletDestroyed(childName: string): void
onOutletDeactivated(): Map<string, OutletContext>
onOutletReAttached(contexts: any)
getOrCreateContext(childName: string): OutletContext
getContext(childName: string): OutletContext | null
}
Methods
onChildOutletCreated() | ||||||
---|---|---|---|---|---|---|
Called when a RouterOutlet directive is instantiated
| ||||||
onChildOutletCreated(childName: string, outlet: RouterOutlet): voidParameters
Returns
|
onChildOutletDestroyed() | |||
---|---|---|---|
Called 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.
| |||
onChildOutletDestroyed(childName: string): voidParameters
Returns
|
onOutletDeactivated() |
---|
Called when the corresponding route is deactivated during navigation. Because the component get destroyed, all children outlet are destroyed. |
onOutletDeactivated(): Map<string, OutletContext>ParametersThere are no parameters. Returns
|
onOutletReAttached() | |||
---|---|---|---|
onOutletReAttached(contexts: any)Parameters
|
getOrCreateContext() | |||
---|---|---|---|
getOrCreateContext(childName: string): OutletContextParameters
Returns
|
getContext() | |||
---|---|---|---|
getContext(childName: string): OutletContext | nullParameters
Returns
|
© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v8.angular.io/api/router/ChildrenOutletContexts