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

Function saveNameToExportMap

packages/core/src/render3/view/directives.ts:534–547  ·  view source on GitHub ↗

* Builds up an export map as directives are created, so local refs can be quickly mapped * to their directive instances.

(
  directiveIdx: number,
  def: DirectiveDef<any> | ComponentDef<any>,
  exportsMap: {[key: string]: number} | null,
)

Source from the content-addressed store, hash-verified

532 * to their directive instances.
533 */
534function saveNameToExportMap(
535 directiveIdx: number,
536 def: DirectiveDef<any> | ComponentDef<any>,
537 exportsMap: {[key: string]: number} | null,
538) {
539 if (exportsMap) {
540 if (def.exportAs) {
541 for (let i = 0; i < def.exportAs.length; i++) {
542 exportsMap[def.exportAs[i]] = directiveIdx;
543 }
544 }
545 if (isComponentDef(def)) exportsMap[''] = directiveIdx;
546 }
547}
548
549/**
550 * Initializes the flags on the current node, setting all indices to the initial index,

Callers 1

initializeDirectivesFunction · 0.85

Calls 1

isComponentDefFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…