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

Function getLocalRefs

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

Source from the content-addressed store, hash-verified

342 * the local references.
343 */
344export function getLocalRefs(target: {}): {[key: string]: any} {
345 const context = getLContext(target);
346 if (context === null) return {};
347
348 if (context.localRefs === undefined) {
349 const lView = context.lView;
350 if (lView === null) {
351 return {};
352 }
353 context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
354 }
355
356 return context.localRefs || {};
357}
358
359/**
360 * 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