MCPcopy
hub / github.com/angular/angular / getLocalRefs

Function getLocalRefs

packages/core/src/render3/util/discovery_utils.ts:341–354  ·  view source on GitHub ↗
(target: {})

Source from the content-addressed store, hash-verified

339 * the local references.
340 */
341export function getLocalRefs(target: {}): {[key: string]: any} {
342 const context = getLContext(target);
343 if (context === null) return {};
344
345 if (context.localRefs === undefined) {
346 const lView = context.lView;
347 if (lView === null) {
348 return {};
349 }
350 context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
351 }
352
353 return context.localRefs || {};
354}
355
356/**
357 * Retrieves the host element of a component or directive instance.

Callers 2

referencesMethod · 0.90

Calls 2

getLContextFunction · 0.90
discoverLocalRefsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…