MCPcopy
hub / github.com/angular/angular / setPropertyAndInputs

Function setPropertyAndInputs

packages/core/src/render3/instructions/shared.ts:250–274  ·  view source on GitHub ↗
(
  tNode: TNode,
  lView: LView,
  propName: string,
  value: T,
  renderer: Renderer,
  sanitizer: SanitizerFn | null | undefined,
)

Source from the content-addressed store, hash-verified

248}
249
250export function setPropertyAndInputs<T>(
251 tNode: TNode,
252 lView: LView,
253 propName: string,
254 value: T,
255 renderer: Renderer,
256 sanitizer: SanitizerFn | null | undefined,
257): void {
258 ngDevMode && assertNotSame(value, NO_CHANGE as any, 'Incoming value should never be NO_CHANGE.');
259 const tView = lView[TVIEW];
260 const hasSetInput = setAllInputsForProperty(tNode, tView, lView, propName, value);
261
262 if (hasSetInput) {
263 isComponentHost(tNode) && markDirtyIfOnPush(lView, tNode.index);
264 ngDevMode && setNgReflectProperties(lView, tView, tNode, propName, value);
265 return; // Stop propcessing if we've matched at least one input.
266 }
267
268 // If the property is going to a DOM node, we have to remap it.
269 if (tNode.type & TNodeType.AnyRNode) {
270 propName = mapPropName(propName);
271 }
272
273 setDomProperty(tNode, lView, propName, value, renderer, sanitizer);
274}
275
276/**
277 * Sets a DOM property on a specific node.

Callers 3

applyUpdateOpCodesFunction · 0.90
ɵɵpropertyFunction · 0.90
ɵɵtwoWayPropertyFunction · 0.90

Calls 7

assertNotSameFunction · 0.90
isComponentHostFunction · 0.90
setAllInputsForPropertyFunction · 0.85
markDirtyIfOnPushFunction · 0.85
setNgReflectPropertiesFunction · 0.85
mapPropNameFunction · 0.85
setDomPropertyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…