MCPcopy Index your code
hub / github.com/angular/angular / interpolationV

Function interpolationV

packages/core/src/render3/instructions/interpolation.ts:28–51  ·  view source on GitHub ↗
(lView: LView, values: any[])

Source from the content-addressed store, hash-verified

26 * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
27 */
28export function interpolationV(lView: LView, values: any[]): string | NO_CHANGE {
29 ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
30 let isBindingUpdated = false;
31 let bindingIndex = getBindingIndex();
32
33 for (let i = 1; i < values.length; i += 2) {
34 // Check if bindings (odd indexes) have changed
35 isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
36 }
37 setBindingIndex(bindingIndex);
38
39 if (!isBindingUpdated) {
40 return NO_CHANGE;
41 }
42
43 // Build the updated content
44 let content = values[0];
45 for (let i = 1; i < values.length; i += 2) {
46 // The condition is to prevent an out-of-bound read
47 content += renderStringify(values[i]) + (i + 1 !== values.length ? values[i + 1] : '');
48 }
49
50 return content;
51}
52
53/**
54 * Creates an interpolation binding with 1 expression.

Callers 2

ɵɵinterpolateVFunction · 0.90
ɵɵtextInterpolateVFunction · 0.90

Calls 5

assertLessThanFunction · 0.90
getBindingIndexFunction · 0.90
bindingUpdatedFunction · 0.90
setBindingIndexFunction · 0.90
renderStringifyFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…