MCPcopy
hub / github.com/angular/angular / checkStylingProperty

Function checkStylingProperty

packages/core/src/render3/instructions/styling.ts:203–231  ·  view source on GitHub ↗
(
  prop: string,
  value: any | NO_CHANGE,
  suffix: string | undefined | null,
  isClassBased: boolean,
)

Source from the content-addressed store, hash-verified

201 * @param isClassBased `true` if `class` change (`false` if `style`)
202 */
203export function checkStylingProperty(
204 prop: string,
205 value: any | NO_CHANGE,
206 suffix: string | undefined | null,
207 isClassBased: boolean,
208): void {
209 const lView = getLView();
210 const tView = getTView();
211 // Styling instructions use 2 slots per binding.
212 // 1. one for the value / TStylingKey
213 // 2. one for the intermittent-value / TStylingRange
214 const bindingIndex = incrementBindingIndex(2);
215 if (tView.firstUpdatePass) {
216 stylingFirstUpdatePass(tView, prop, bindingIndex, isClassBased);
217 }
218 if (value !== NO_CHANGE && bindingUpdated(lView, bindingIndex, value)) {
219 const tNode = tView.data[getSelectedIndex()] as TNode;
220 updateStyling(
221 tView,
222 tNode,
223 lView,
224 lView[RENDERER],
225 prop,
226 (lView[bindingIndex + 1] = normalizeSuffix(value, suffix)),
227 isClassBased,
228 bindingIndex,
229 );
230 }
231}
232
233/**
234 * Common code between `ɵɵclassMap` and `ɵɵstyleMap`.

Callers 2

ɵɵstylePropFunction · 0.85
ɵɵclassPropFunction · 0.85

Calls 8

getLViewFunction · 0.90
getTViewFunction · 0.90
incrementBindingIndexFunction · 0.90
bindingUpdatedFunction · 0.90
getSelectedIndexFunction · 0.90
stylingFirstUpdatePassFunction · 0.85
updateStylingFunction · 0.85
normalizeSuffixFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…