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

Function clearDirectiveDefs

packages/core/test/acceptance/defer_spec.ts:62–66  ·  view source on GitHub ↗

* Clears all associated directive defs from a given component class. * * This is a *hack* for TestBed, which compiles components in JIT mode * and can not remove dependencies and their imports in the same way as AOT. * From JIT perspective, all dependencies inside a defer block remain eager. *

(type: Type<unknown>)

Source from the content-addressed store, hash-verified

60 * prefetching behavior.
61 */
62function clearDirectiveDefs(type: Type<unknown>): void {
63 const cmpDef = getComponentDef(type);
64 cmpDef!.dependencies = [];
65 cmpDef!.directiveDefs = null;
66}
67
68/**
69 * Emulates a dynamic import promise.

Callers 2

createFixtureFunction · 0.85
defer_spec.tsFile · 0.85

Calls 1

getComponentDefFunction · 0.90

Tested by

no test coverage detected