MCPcopy
hub / github.com/angular/angular / attachToAppRef

Method attachToAppRef

packages/core/src/render3/view_ref.ts:362–376  ·  view source on GitHub ↗
(appRef: ApplicationRef)

Source from the content-addressed store, hash-verified

360 }
361
362 attachToAppRef(appRef: ApplicationRef) {
363 if (this._attachedToViewContainer) {
364 throw new RuntimeError(
365 RuntimeErrorCode.VIEW_ALREADY_ATTACHED,
366 ngDevMode && 'This view is already attached to a ViewContainer!',
367 );
368 }
369 this._appRef = appRef;
370 const isRoot = isRootView(this._lView);
371 const declarationContainer = this._lView[DECLARATION_LCONTAINER];
372 if (declarationContainer !== null && !isRoot) {
373 trackMovedView(declarationContainer, this._lView);
374 }
375 updateAncestorTraversalFlagsOnAttach(this._lView);
376 }
377}
378
379/**

Callers 2

createMethod · 0.80
attachViewMethod · 0.80

Calls 3

isRootViewFunction · 0.90
trackMovedViewFunction · 0.90

Tested by

no test coverage detected