|
6 | 6 | * found in the LICENSE file at https://angular.io/license
|
7 | 7 | */
|
8 | 8 | import {SanitizerFn} from '../interfaces/sanitization';
|
9 |
| -import {getSelectedIndex} from '../state'; |
10 |
| -import {ɵɵelementAttribute} from './element'; |
| 9 | +import {getLView, getSelectedIndex} from '../state'; |
| 10 | +import {NO_CHANGE} from '../tokens'; |
| 11 | + |
11 | 12 | import {ɵɵinterpolation1, ɵɵinterpolation2, ɵɵinterpolation3, ɵɵinterpolation4, ɵɵinterpolation5, ɵɵinterpolation6, ɵɵinterpolation7, ɵɵinterpolation8, ɵɵinterpolationV} from './interpolation';
|
12 |
| -import {TsickleIssue1009} from './shared'; |
| 13 | +import {TsickleIssue1009, elementAttributeInternal} from './shared'; |
13 | 14 |
|
14 | 15 |
|
15 | 16 |
|
@@ -41,12 +42,13 @@ export function ɵɵattributeInterpolate1(
|
41 | 42 | attrName: string, prefix: string, v0: any, suffix: string, sanitizer?: SanitizerFn,
|
42 | 43 | namespace?: string): TsickleIssue1009 {
|
43 | 44 | const index = getSelectedIndex();
|
| 45 | + const lView = getLView(); |
44 | 46 |
|
45 | 47 | // TODO(FW-1340): Refactor to remove the use of other instructions here.
|
46 | 48 | const interpolatedValue = ɵɵinterpolation1(prefix, v0, suffix);
|
47 |
| - |
48 |
| - ɵɵelementAttribute(index, attrName, interpolatedValue, sanitizer, namespace); |
49 |
| - |
| 49 | + if (interpolatedValue !== NO_CHANGE) { |
| 50 | + elementAttributeInternal(index, attrName, interpolatedValue, lView, sanitizer, namespace); |
| 51 | + } |
50 | 52 | return ɵɵattributeInterpolate1;
|
51 | 53 | }
|
52 | 54 |
|
@@ -80,10 +82,13 @@ export function ɵɵattributeInterpolate2(
|
80 | 82 | attrName: string, prefix: string, v0: any, i0: string, v1: any, suffix: string,
|
81 | 83 | sanitizer?: SanitizerFn, namespace?: string): TsickleIssue1009 {
|
82 | 84 | const index = getSelectedIndex();
|
| 85 | + const lView = getLView(); |
83 | 86 |
|
84 | 87 | // TODO(FW-1340): Refactor to remove the use of other instructions here.
|
85 | 88 | const interpolatedValue = ɵɵinterpolation2(prefix, v0, i0, v1, suffix);
|
86 |
| - ɵɵelementAttribute(index, attrName, interpolatedValue, sanitizer, namespace); |
| 89 | + if (interpolatedValue !== NO_CHANGE) { |
| 90 | + elementAttributeInternal(index, attrName, interpolatedValue, lView, sanitizer, namespace); |
| 91 | + } |
87 | 92 | return ɵɵattributeInterpolate2;
|
88 | 93 | }
|
89 | 94 |
|
@@ -120,10 +125,13 @@ export function ɵɵattributeInterpolate3(
|
120 | 125 | attrName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any,
|
121 | 126 | suffix: string, sanitizer?: SanitizerFn, namespace?: string): TsickleIssue1009 {
|
122 | 127 | const index = getSelectedIndex();
|
| 128 | + const lView = getLView(); |
123 | 129 |
|
124 | 130 | // TODO(FW-1340): Refactor to remove the use of other instructions here.
|
125 | 131 | const interpolatedValue = ɵɵinterpolation3(prefix, v0, i0, v1, i1, v2, suffix);
|
126 |
| - ɵɵelementAttribute(index, attrName, interpolatedValue, sanitizer, namespace); |
| 132 | + if (interpolatedValue !== NO_CHANGE) { |
| 133 | + elementAttributeInternal(index, attrName, interpolatedValue, lView, sanitizer, namespace); |
| 134 | + } |
127 | 135 | return ɵɵattributeInterpolate3;
|
128 | 136 | }
|
129 | 137 |
|
@@ -162,10 +170,13 @@ export function ɵɵattributeInterpolate4(
|
162 | 170 | attrName: string, prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string,
|
163 | 171 | v3: any, suffix: string, sanitizer?: SanitizerFn, namespace?: string): TsickleIssue1009 {
|
164 | 172 | const index = getSelectedIndex();
|
| 173 | + const lView = getLView(); |
165 | 174 |
|
166 | 175 | // TODO(FW-1340): Refactor to remove the use of other instructions here.
|
167 | 176 | const interpolatedValue = ɵɵinterpolation4(prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
|
168 |
| - ɵɵelementAttribute(index, attrName, interpolatedValue, sanitizer, namespace); |
| 177 | + if (interpolatedValue !== NO_CHANGE) { |
| 178 | + elementAttributeInternal(index, attrName, interpolatedValue, lView, sanitizer, namespace); |
| 179 | + } |
169 | 180 | return ɵɵattributeInterpolate4;
|
170 | 181 | }
|
171 | 182 |
|
@@ -207,10 +218,13 @@ export function ɵɵattributeInterpolate5(
|
207 | 218 | v3: any, i3: string, v4: any, suffix: string, sanitizer?: SanitizerFn,
|
208 | 219 | namespace?: string): TsickleIssue1009 {
|
209 | 220 | const index = getSelectedIndex();
|
| 221 | + const lView = getLView(); |
210 | 222 |
|
211 | 223 | // TODO(FW-1340): Refactor to remove the use of other instructions here.
|
212 | 224 | const interpolatedValue = ɵɵinterpolation5(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
|
213 |
| - ɵɵelementAttribute(index, attrName, interpolatedValue, sanitizer, namespace); |
| 225 | + if (interpolatedValue !== NO_CHANGE) { |
| 226 | + elementAttributeInternal(index, attrName, interpolatedValue, lView, sanitizer, namespace); |
| 227 | + } |
214 | 228 | return ɵɵattributeInterpolate5;
|
215 | 229 | }
|
216 | 230 |
|
@@ -254,10 +268,13 @@ export function ɵɵattributeInterpolate6(
|
254 | 268 | v3: any, i3: string, v4: any, i4: string, v5: any, suffix: string, sanitizer?: SanitizerFn,
|
255 | 269 | namespace?: string): TsickleIssue1009 {
|
256 | 270 | const index = getSelectedIndex();
|
| 271 | + const lView = getLView(); |
257 | 272 | // TODO(FW-1340): Refactor to remove the use of other instructions here.
|
258 | 273 | const interpolatedValue =
|
259 | 274 | ɵɵinterpolation6(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix);
|
260 |
| - ɵɵelementAttribute(index, attrName, interpolatedValue, sanitizer, namespace); |
| 275 | + if (interpolatedValue !== NO_CHANGE) { |
| 276 | + elementAttributeInternal(index, attrName, interpolatedValue, lView, sanitizer, namespace); |
| 277 | + } |
261 | 278 | return ɵɵattributeInterpolate6;
|
262 | 279 | }
|
263 | 280 |
|
@@ -303,10 +320,13 @@ export function ɵɵattributeInterpolate7(
|
303 | 320 | v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string,
|
304 | 321 | sanitizer?: SanitizerFn, namespace?: string): TsickleIssue1009 {
|
305 | 322 | const index = getSelectedIndex();
|
| 323 | + const lView = getLView(); |
306 | 324 | // TODO(FW-1340): Refactor to remove the use of other instructions here.
|
307 | 325 | const interpolatedValue =
|
308 | 326 | ɵɵinterpolation7(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix);
|
309 |
| - ɵɵelementAttribute(index, attrName, interpolatedValue, sanitizer, namespace); |
| 327 | + if (interpolatedValue !== NO_CHANGE) { |
| 328 | + elementAttributeInternal(index, attrName, interpolatedValue, lView, sanitizer, namespace); |
| 329 | + } |
310 | 330 | return ɵɵattributeInterpolate7;
|
311 | 331 | }
|
312 | 332 |
|
@@ -354,10 +374,13 @@ export function ɵɵattributeInterpolate8(
|
354 | 374 | v3: any, i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any,
|
355 | 375 | suffix: string, sanitizer?: SanitizerFn, namespace?: string): TsickleIssue1009 {
|
356 | 376 | const index = getSelectedIndex();
|
| 377 | + const lView = getLView(); |
357 | 378 | // TODO(FW-1340): Refactor to remove the use of other instructions here.
|
358 | 379 | const interpolatedValue =
|
359 | 380 | ɵɵinterpolation8(prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix);
|
360 |
| - ɵɵelementAttribute(index, attrName, interpolatedValue, sanitizer, namespace); |
| 381 | + if (interpolatedValue !== NO_CHANGE) { |
| 382 | + elementAttributeInternal(index, attrName, interpolatedValue, lView, sanitizer, namespace); |
| 383 | + } |
361 | 384 | return ɵɵattributeInterpolate8;
|
362 | 385 | }
|
363 | 386 |
|
@@ -391,7 +414,11 @@ export function ɵɵattributeInterpolateV(
|
391 | 414 | attrName: string, values: any[], sanitizer?: SanitizerFn,
|
392 | 415 | namespace?: string): TsickleIssue1009 {
|
393 | 416 | const index = getSelectedIndex();
|
| 417 | + const lView = getLView(); |
394 | 418 | // TODO(FW-1340): Refactor to remove the use of other instructions here.
|
395 |
| - ɵɵelementAttribute(index, attrName, ɵɵinterpolationV(values), sanitizer, namespace); |
| 419 | + const interpolated = ɵɵinterpolationV(values); |
| 420 | + if (interpolated !== NO_CHANGE) { |
| 421 | + elementAttributeInternal(index, attrName, interpolated, lView, sanitizer, namespace); |
| 422 | + } |
396 | 423 | return ɵɵattributeInterpolateV;
|
397 | 424 | }
|
0 commit comments