/
change_detection_transplanted_view_spec.ts
635 lines (573 loc) Β· 24.2 KB
/
change_detection_transplanted_view_spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {CommonModule} from '@angular/common';
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, DoCheck, Input, TemplateRef, Type, ViewChild, ViewContainerRef} from '@angular/core';
import {AfterViewChecked} from '@angular/core/src/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {expect} from '@angular/platform-browser/testing/src/matchers';
import {onlyInIvy} from '@angular/private/testing';
describe('change detection for transplanted views', () => {
describe('when declaration appears before insertion', () => {
const insertCompTemplate = `
InsertComp({{greeting}})
<div *ngIf="true">
<!-- Add extra level of embedded view to ensure we can handle nesting -->
<ng-container
[ngTemplateOutlet]="template"
[ngTemplateOutletContext]="{$implicit: greeting}">
</ng-container>
</div>
`;
@Component({
selector: 'insert-comp',
changeDetection: ChangeDetectionStrategy.OnPush,
template: insertCompTemplate,
})
class InsertComp implements DoCheck, AfterViewChecked {
get template(): TemplateRef<any> {
return declareComp.myTmpl;
}
greeting: string = 'Hello';
constructor(public changeDetectorRef: ChangeDetectorRef) {
if (!(this instanceof InsertForOnPushDeclareComp)) {
insertComp = this;
}
}
ngDoCheck(): void {
logValue = 'Insert';
}
ngAfterViewChecked(): void {
logValue = null;
}
}
@Component({
selector: 'insert-for-onpush-declare-comp',
changeDetection: ChangeDetectionStrategy.OnPush,
template: insertCompTemplate,
})
class InsertForOnPushDeclareComp extends InsertComp {
constructor(public changeDetectorRef: ChangeDetectorRef) {
super(changeDetectorRef);
insertForOnPushDeclareComp = this;
}
get template(): TemplateRef<any> {
return onPushDeclareComp.myTmpl;
}
}
@Component({
selector: `declare-comp`,
template: `
DeclareComp({{name}})
<ng-template #myTmpl let-greeting>
{{greeting}} {{logName()}}!
</ng-template>
`
})
class DeclareComp implements DoCheck, AfterViewChecked {
@ViewChild('myTmpl') myTmpl!: TemplateRef<any>;
name: string = 'world';
constructor(readonly changeDetector: ChangeDetectorRef) {
if (!(this instanceof OnPushDeclareComp)) {
declareComp = this;
}
}
ngDoCheck(): void {
logValue = 'Declare';
}
logName() {
// This will log when the embedded view gets CD. The `logValue` will show if the CD was
// from `Insert` or from `Declare` component.
log.push(logValue!);
return this.name;
}
ngAfterViewChecked(): void {
logValue = null;
}
}
@Component({
selector: `onpush-declare-comp`,
template: `
OnPushDeclareComp({{name}})
<ng-template #myTmpl let-greeting>
{{greeting}} {{logName()}}!
</ng-template>
`,
changeDetection: ChangeDetectionStrategy.OnPush
})
class OnPushDeclareComp extends DeclareComp {
constructor(readonly changeDetector: ChangeDetectorRef) {
super(changeDetector);
onPushDeclareComp = this;
}
}
@Component({
template: `
<declare-comp *ngIf="showDeclare"></declare-comp>
<onpush-declare-comp *ngIf="showOnPushDeclare"></onpush-declare-comp>
<insert-comp *ngIf="showInsert"></insert-comp>
<insert-for-onpush-declare-comp *ngIf="showInsertForOnPushDeclare"></insert-for-onpush-declare-comp>
`
})
class AppComp {
showDeclare: boolean = false;
showOnPushDeclare: boolean = false;
showInsert: boolean = false;
showInsertForOnPushDeclare: boolean = false;
constructor() {
appComp = this;
}
}
let log!: Array<string|null>;
let logValue!: string|null;
let fixture!: ComponentFixture<AppComp>;
let appComp!: AppComp;
let insertComp!: InsertComp;
let insertForOnPushDeclareComp!: InsertForOnPushDeclareComp;
let declareComp!: DeclareComp;
let onPushDeclareComp!: OnPushDeclareComp;
beforeEach(() => {
TestBed.configureTestingModule({
declarations:
[InsertComp, DeclareComp, OnPushDeclareComp, InsertForOnPushDeclareComp, AppComp],
imports: [CommonModule],
});
log = [];
fixture = TestBed.createComponent(AppComp);
});
describe('and declaration component is CheckAlways', () => {
beforeEach(() => {
fixture.componentInstance.showDeclare = true;
fixture.componentInstance.showInsert = true;
fixture.detectChanges(false);
log.length = 0;
});
it('should set up the component under test correctly', () => {
expect(log.length).toEqual(0);
expect(trim(fixture.nativeElement.textContent))
.toEqual('DeclareComp(world) InsertComp(Hello) Hello world!');
});
it('should CD at insertion point only', () => {
declareComp.name = 'Angular';
fixture.detectChanges(false);
expect(log).toEqual(['Insert']);
log.length = 0;
expect(trim(fixture.nativeElement.textContent))
.toEqual(
'DeclareComp(Angular) InsertComp(Hello) Hello Angular!',
'Expect transplanted LView to be CD because the declaration is CD.');
insertComp.greeting = 'Hi';
fixture.detectChanges(false);
expect(log).toEqual(['Insert']);
log.length = 0;
expect(trim(fixture.nativeElement.textContent))
.toEqual(
'DeclareComp(Angular) InsertComp(Hello) Hello Angular!',
'expect no change because it is on push.');
insertComp.changeDetectorRef.markForCheck();
fixture.detectChanges(false);
expect(log).toEqual(['Insert']);
log.length = 0;
expect(trim(fixture.nativeElement.textContent))
.toEqual('DeclareComp(Angular) InsertComp(Hi) Hi Angular!');
// Destroy insertion should also destroy declaration
appComp.showInsert = false;
fixture.detectChanges(false);
expect(log).toEqual([]);
log.length = 0;
expect(trim(fixture.nativeElement.textContent)).toEqual('DeclareComp(Angular)');
// Restore both
appComp.showInsert = true;
fixture.detectChanges(false);
expect(log).toEqual(['Insert']);
log.length = 0;
expect(trim(fixture.nativeElement.textContent))
.toEqual('DeclareComp(Angular) InsertComp(Hello) Hello Angular!');
// Destroy declaration, But we should still be able to see updates in insertion
appComp.showDeclare = false;
insertComp.greeting = 'Hello';
insertComp.changeDetectorRef.markForCheck();
fixture.detectChanges(false);
expect(log).toEqual(['Insert']);
log.length = 0;
expect(trim(fixture.nativeElement.textContent)).toEqual('InsertComp(Hello) Hello Angular!');
});
it('is not checked if detectChanges is called in declaration component', () => {
declareComp.name = 'Angular';
declareComp.changeDetector.detectChanges();
expect(log).toEqual([]);
log.length = 0;
expect(trim(fixture.nativeElement.textContent))
.toEqual('DeclareComp(Angular) InsertComp(Hello) Hello world!');
});
it('is checked as part of CheckNoChanges pass', () => {
fixture.detectChanges(true);
expect(log).toEqual(['Insert', null /* logName set to null afterViewChecked */]);
log.length = 0;
expect(trim(fixture.nativeElement.textContent))
.toEqual('DeclareComp(world) InsertComp(Hello) Hello world!');
});
});
describe('and declaration component is OnPush', () => {
beforeEach(() => {
fixture.componentInstance.showOnPushDeclare = true;
fixture.componentInstance.showInsertForOnPushDeclare = true;
fixture.detectChanges(false);
log.length = 0;
});
it('should set up component under test correctly', () => {
expect(log.length).toEqual(0);
expect(trim(fixture.nativeElement.textContent))
.toEqual('OnPushDeclareComp(world) InsertComp(Hello) Hello world!');
});
it('should not check anything no views are dirty', () => {
fixture.detectChanges(false);
expect(log).toEqual([]);
});
it('should CD at insertion point only', () => {
onPushDeclareComp.name = 'Angular';
insertForOnPushDeclareComp.greeting = 'Hi';
// mark declaration point dirty
onPushDeclareComp.changeDetector.markForCheck();
fixture.detectChanges(false);
expect(log).toEqual(['Insert']);
log.length = 0;
expect(trim(fixture.nativeElement.textContent))
.toEqual('OnPushDeclareComp(Angular) InsertComp(Hello) Hello Angular!');
// mark insertion point dirty
insertForOnPushDeclareComp.changeDetectorRef.markForCheck();
fixture.detectChanges(false);
expect(log).toEqual(['Insert']);
log.length = 0;
expect(trim(fixture.nativeElement.textContent))
.toEqual('OnPushDeclareComp(Angular) InsertComp(Hi) Hi Angular!');
// mark both insertion and declaration point dirty
insertForOnPushDeclareComp.changeDetectorRef.markForCheck();
onPushDeclareComp.changeDetector.markForCheck();
fixture.detectChanges(false);
expect(log).toEqual(['Insert']);
log.length = 0;
});
it('is not checked if detectChanges is called in declaration component', () => {
onPushDeclareComp.name = 'Angular';
onPushDeclareComp.changeDetector.detectChanges();
expect(log).toEqual([]);
log.length = 0;
expect(trim(fixture.nativeElement.textContent))
.toEqual('OnPushDeclareComp(Angular) InsertComp(Hello) Hello world!');
});
// TODO(FW-1774): blocked by https://github.com/angular/angular/pull/34443
xit('is checked as part of CheckNoChanges pass', () => {
// mark declaration point dirty
onPushDeclareComp.changeDetector.markForCheck();
fixture.detectChanges(false);
expect(log).toEqual(['Insert', null /* logName set to null in afterViewChecked */]);
log.length = 0;
// mark insertion point dirty
insertForOnPushDeclareComp.changeDetectorRef.markForCheck();
fixture.detectChanges(false);
expect(log).toEqual(['Insert', null]);
log.length = 0;
// mark both insertion and declaration point dirty
insertForOnPushDeclareComp.changeDetectorRef.markForCheck();
onPushDeclareComp.changeDetector.markForCheck();
fixture.detectChanges(false);
expect(log).toEqual(['Insert', null]);
log.length = 0;
});
});
});
// Note that backwards references are not handled well in VE or Ivy at the moment.
// These tests assert the current behavior. Some of these would need to be updated
// if future work refreshes backwards referenced transplanted views.
describe('backwards references', () => {
@Component({
selector: 'insertion',
template: `
<div>Insertion({{name}})</div>
<ng-container [ngTemplateOutlet]="template" [ngTemplateOutletContext]="{$implicit: name}">
</ng-container>`,
changeDetection: ChangeDetectionStrategy.OnPush
})
class Insertion {
@Input() template !: TemplateRef<{}>;
name = 'initial';
constructor(readonly changeDetectorRef: ChangeDetectorRef) {}
}
@Component({
selector: 'declaration',
template: `
<div>Declaration({{name}})</div>
<ng-template #template let-contextName>
<div>{{incrementChecks()}}</div>
<div>TemplateDeclaration({{name}})</div>
<div>TemplateContext({{contextName}})</div>
</ng-template>
`,
changeDetection: ChangeDetectionStrategy.OnPush
})
class Declaration {
@ViewChild('template') template?: TemplateRef<{}>;
name = 'initial';
transplantedViewRefreshCount = 0;
constructor(readonly changeDetectorRef: ChangeDetectorRef) {}
incrementChecks() {
this.transplantedViewRefreshCount++;
}
}
let fixture: ComponentFixture<App>;
let appComponent: App;
@Component({
template: `
<insertion *ngIf="showInsertion" [template]="declaration?.template">
</insertion>
<declaration></declaration>
`
})
class App {
@ViewChild(Declaration) declaration!: Declaration;
@ViewChild(Insertion) insertion!: Insertion;
template?: TemplateRef<{}>;
showInsertion = false;
}
beforeEach(() => {
fixture = TestBed.configureTestingModule({declarations: [App, Declaration, Insertion]})
.createComponent(App);
appComponent = fixture.componentInstance;
fixture.detectChanges(false);
appComponent.showInsertion = true;
fixture.detectChanges(false);
appComponent.declaration.transplantedViewRefreshCount = 0;
});
it('should set up component under test correctly', () => {
expect(fixture.nativeElement.textContent)
.toEqual(
'Insertion(initial)TemplateDeclaration(initial)TemplateContext(initial)Declaration(initial)');
expect(appComponent.declaration.transplantedViewRefreshCount).toEqual(0);
});
it('should not update declaration view when there is a change in the declaration and insertion is marked dirty',
() => {
appComponent.declaration.name = 'new name';
appComponent.insertion.changeDetectorRef.markForCheck();
fixture.detectChanges(false);
expect(fixture.nativeElement.textContent)
.toEqual(
'Insertion(initial)TemplateDeclaration(new name)TemplateContext(initial)Declaration(initial)',
'Name should not update in declaration view because only insertion was marked dirty');
expect(appComponent.declaration.transplantedViewRefreshCount).toEqual(1);
});
it('updates only the declaration view when there is a change to declaration and declaration is marked dirty',
() => {
appComponent.declaration.name = 'new name';
appComponent.declaration.changeDetectorRef.markForCheck();
fixture.detectChanges(false);
const expectedContent =
'Insertion(initial)TemplateDeclaration(initial)TemplateContext(initial)Declaration(new name)';
expect(fixture.nativeElement.textContent).toEqual(expectedContent);
expect(appComponent.declaration.transplantedViewRefreshCount).toEqual(0);
// Note here that this second change detection should not be necessary, but is because of
// the backwards reference not being fully supported. The assertions below should be true
// after the first CD.
fixture.detectChanges(false);
expect(fixture.nativeElement.textContent)
.toEqual(
'Insertion(initial)TemplateDeclaration(new name)TemplateContext(initial)Declaration(new name)');
expect(appComponent.declaration.transplantedViewRefreshCount).toEqual(1);
});
it('should not update anything when there is a change to insertion and declaration is marked dirty',
() => {
appComponent.insertion.name = 'new name';
appComponent.declaration.changeDetectorRef.markForCheck();
fixture.detectChanges(false);
// Name should not update in insertion view because only declaration was marked dirty
// Context name also does not update in the template because the insertion view needs to be
// checked to update the `ngTemplateOutletContext` input.
expect(fixture.nativeElement.textContent)
.toEqual(
'Insertion(initial)TemplateDeclaration(initial)TemplateContext(initial)Declaration(initial)',
'Name should not update in insertion view because only declaration was marked dirty\n' +
'Context name also does not update in the template because the insertion view needs to be' +
'checked to update the `ngTemplateOutletContext` input.');
// Note here that if backwards references were better supported, we would be able to
// refresh the transplanted view in the first `detectChanges` call but because the
// insertion point was already checked, we need to call detectChanges again to refresh it.
expect(appComponent.declaration.transplantedViewRefreshCount).toEqual(0);
fixture.detectChanges(false);
expect(fixture.nativeElement.textContent)
.toEqual(
'Insertion(initial)TemplateDeclaration(initial)TemplateContext(initial)Declaration(initial)',
'Expected bindings to still be initial values. Again, TemplateContext can only update if ' +
'insertion point is dirty and updates the ngTemplateOutletContext input.');
expect(appComponent.declaration.transplantedViewRefreshCount).toEqual(1);
});
it('should update insertion view and template when there is a change to insertion and insertion marked dirty',
() => {
appComponent.insertion.name = 'new name';
appComponent.insertion.changeDetectorRef.markForCheck();
fixture.detectChanges(false);
expect(fixture.nativeElement.textContent)
.toEqual(
'Insertion(new name)TemplateDeclaration(initial)TemplateContext(new name)Declaration(initial)');
expect(appComponent.declaration.transplantedViewRefreshCount).toEqual(1);
});
it('should not refresh the template if nothing is marked dirty', () => {
fixture.detectChanges(false);
expect(appComponent.declaration.transplantedViewRefreshCount).toEqual(0);
});
it('should only refresh template once when declaration and insertion are marked dirty', () => {
appComponent.declaration.changeDetectorRef.markForCheck();
appComponent.insertion.changeDetectorRef.markForCheck();
fixture.detectChanges(false);
expect(appComponent.declaration.transplantedViewRefreshCount)
.toEqual(
1,
'Expected transplanted view to only be refreshed when insertion component is refreshed');
});
});
describe('transplanted views shielded by OnPush', () => {
@Component({
selector: 'check-always-insertion',
template: `<ng-container [ngTemplateOutlet]="template"></ng-container>`
})
class CheckAlwaysInsertion {
@Input() template !: TemplateRef<{}>;
}
@Component({
selector: 'on-push-insertion-host',
template: `<check-always-insertion [template]="template"></check-always-insertion>`,
changeDetection: ChangeDetectionStrategy.OnPush
})
class OnPushInsertionHost {
@Input() template !: TemplateRef<{}>;
constructor(readonly cdr: ChangeDetectorRef) {}
}
@Component({
template: `
<ng-template #template>{{value}}</ng-template>
<on-push-insertion-host [template]="template"></on-push-insertion-host>
`,
changeDetection: ChangeDetectionStrategy.OnPush
})
class OnPushDeclaration {
@ViewChild(OnPushInsertionHost) onPushInsertionHost?: OnPushInsertionHost;
value = 'initial';
constructor(readonly cdr: ChangeDetectorRef) {}
}
@Component({
template: `
<ng-template #template>{{value}}</ng-template>
<on-push-insertion-host [template]="template"></on-push-insertion-host>
`
})
class CheckAlwaysDeclaration {
@ViewChild(OnPushInsertionHost) onPushInsertionHost?: OnPushInsertionHost;
value = 'initial';
}
function getFixture<T>(componentUnderTest: Type<T>): ComponentFixture<T> {
return TestBed
.configureTestingModule({
declarations: [
CheckAlwaysDeclaration, OnPushDeclaration, CheckAlwaysInsertion, OnPushInsertionHost
]
})
.createComponent(componentUnderTest);
}
it('refresh when transplanted view is declared in CheckAlways component', () => {
const fixture = getFixture(CheckAlwaysDeclaration);
fixture.detectChanges();
fixture.componentInstance.value = 'new';
fixture.detectChanges();
expect(fixture.nativeElement.textContent).toEqual('new');
});
it('refresh when transplanted view is declared in OnPush component', () => {
const fixture = getFixture(OnPushDeclaration);
fixture.detectChanges();
fixture.componentInstance.value = 'new';
fixture.componentInstance.cdr.markForCheck();
fixture.detectChanges();
expect(fixture.nativeElement.textContent).toEqual('new');
});
onlyInIvy('behavior is inconsistent in VE').describe('when insertion is detached', () => {
it('does not refresh CheckAlways transplants', () => {
const fixture = getFixture(CheckAlwaysDeclaration);
fixture.detectChanges();
fixture.componentInstance.onPushInsertionHost!.cdr.detach();
fixture.componentInstance.value = 'new';
fixture.detectChanges();
expect(fixture.nativeElement.textContent).toEqual('initial');
});
it('does not refresh OnPush transplants', () => {
const fixture = getFixture(OnPushDeclaration);
fixture.detectChanges();
fixture.componentInstance.onPushInsertionHost!.cdr.detach();
fixture.componentInstance.value = 'new';
fixture.detectChanges();
expect(fixture.nativeElement.textContent).toEqual('initial');
});
});
});
it('refreshes transplanted views used as template in ngForTemplate', () => {
@Component({
selector: 'triple',
template: '<div *ngFor="let unused of [1,2,3]; template: template"></div>',
changeDetection: ChangeDetectionStrategy.OnPush
})
class TripleTemplate {
@Input() template !: TemplateRef<{}>;
}
@Component({
template: `
<ng-template #template>{{name}}</ng-template>
<triple [template]="template"></triple>
`
})
class App {
name = 'Penny';
}
const fixture =
TestBed.configureTestingModule({declarations: [App, TripleTemplate]}).createComponent(App);
fixture.detectChanges();
expect(fixture.nativeElement.textContent).toEqual('PennyPennyPenny');
fixture.componentInstance.name = 'Sheldon';
fixture.detectChanges();
expect(fixture.nativeElement.textContent)
.toEqual(
'SheldonSheldonSheldon',
'Expected transplanted view to be refreshed even when insertion is not dirty');
});
it('should not fail when change detecting detached transplanted view', () => {
@Component({template: '<ng-template>{{incrementChecks()}}</ng-template>'})
class AppComponent {
@ViewChild(TemplateRef) templateRef!: TemplateRef<{}>;
constructor(readonly rootVref: ViewContainerRef, readonly cdr: ChangeDetectorRef) {}
checks = 0;
incrementChecks() {
this.checks++;
}
}
const fixture = TestBed.configureTestingModule({declarations: [AppComponent]})
.createComponent(AppComponent);
const component = fixture.componentInstance;
fixture.detectChanges();
const viewRef = component.templateRef.createEmbeddedView({});
// This `ViewContainerRef` is for the root view
component.rootVref.insert(viewRef);
// `detectChanges` on this `ChangeDetectorRef` will refresh this view and children, not the root
// view that has the transplanted `viewRef` inserted.
component.cdr.detectChanges();
// The template should not have been refreshed because it was inserted "above" the component so
// `detectChanges` will not refresh it.
expect(component.checks).toEqual(0);
// Detach view, manually call `detectChanges`, and verify the template was refreshed
component.rootVref.detach();
viewRef.detectChanges();
expect(component.checks).toEqual(1);
});
});
function trim(text: string|null): string {
return text ? text.replace(/[\s\n]+/gm, ' ').trim() : '';
}