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

Function checkStylingProperty

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

Source from the content-addressed store, hash-verified

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

Callers 2

ɵɵstylePropFunction · 0.85
ɵɵclassPropFunction · 0.85

Calls 9

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