MCPcopy Create free account
hub / github.com/angular/angular / attach

Method attach

packages/router/src/directives/router_outlet.ts:390–397  ·  view source on GitHub ↗

* Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree

(ref: ComponentRef<any>, activatedRoute: ActivatedRoute)

Source from the content-addressed store, hash-verified

388 * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree
389 */
390 attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute): void {
391 this.activated = ref;
392 this._activatedRoute = activatedRoute;
393 this.isErrorComponentActive = false;
394 this.location.insert(ref.hostView);
395 this.inputBinder?.bindActivatedRouteToOutletComponent(this, this.location.injector);
396 this.attachEvents.emit(ref.instance);
397 }
398
399 deactivate(): void {
400 // The outlet is no longer associated with the route at all, unlike `destroyActivatedComponent`

Callers 1

Calls 3

emitMethod · 0.65
insertMethod · 0.45

Tested by

no test coverage detected