MCPcopy Index your code
hub / github.com/angular/angular / doDowngrade

Function doDowngrade

packages/upgrade/src/common/src/downgrade_component.ts:197–227  ·  view source on GitHub ↗
(injector: Injector, moduleInjector: Injector)

Source from the content-addressed store, hash-verified

195 const finalModuleInjector = moduleInjector || parentInjector!;
196
197 const doDowngrade = (injector: Injector, moduleInjector: Injector) => {
198 const injectorPromise = new ParentInjectorPromise(element);
199 const facade = new DowngradeComponentAdapter(
200 element,
201 attrs,
202 scope,
203 ngModel,
204 moduleInjector.get(EnvironmentInjector),
205 injector,
206 $compile,
207 $parse,
208 info.component,
209 wrapCallback,
210 unsafelyOverwriteSignalInputs,
211 );
212
213 const projectableNodes = facade.compileContents();
214 const componentRef = facade.createComponentAndSetup(
215 projectableNodes,
216 isNgUpgradeLite,
217 info.propagateDigest,
218 );
219
220 injectorPromise.resolve(componentRef.injector);
221
222 if (ranAsync) {
223 // If this is run async, it is possible that it is not run inside a
224 // digest and initial input values will not be detected.
225 scope.$evalAsync(() => {});
226 }
227 };
228
229 const downgradeFn = !isNgUpgradeLite
230 ? doDowngrade

Callers 1

directiveFactoryFunction · 0.85

Calls 5

compileContentsMethod · 0.95
resolveMethod · 0.95
getMethod · 0.65
$evalAsyncMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…