Skip to content

Commit 2b0315d

Browse files
authored
feat: add preserveWhitespaces: false to all components (#7115)
Also adds lint check to enforce its presence
1 parent 3293a6d commit 2b0315d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+88
-7
lines changed

src/cdk/stepper/stepper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export class StepperSelectionEvent {
6060
moduleId: module.id,
6161
selector: 'cdk-step',
6262
templateUrl: 'step.html',
63-
encapsulation: ViewEncapsulation.None
63+
encapsulation: ViewEncapsulation.None,
64+
preserveWhitespaces: false,
6465
})
6566
export class CdkStep {
6667
/** Template for step label if it exists. */

src/cdk/table/row.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export class CdkCellOutlet {
150150
},
151151
changeDetection: ChangeDetectionStrategy.OnPush,
152152
encapsulation: ViewEncapsulation.None,
153+
preserveWhitespaces: false,
153154
})
154155
export class CdkHeaderRow { }
155156

@@ -164,5 +165,6 @@ export class CdkHeaderRow { }
164165
},
165166
changeDetection: ChangeDetectionStrategy.OnPush,
166167
encapsulation: ViewEncapsulation.None,
168+
preserveWhitespaces: false,
167169
})
168170
export class CdkRow { }

src/cdk/table/table.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export const CDK_TABLE_TEMPLATE = `
7676
'class': 'cdk-table',
7777
},
7878
encapsulation: ViewEncapsulation.None,
79+
preserveWhitespaces: false,
7980
changeDetection: ChangeDetectionStrategy.OnPush,
8081
})
8182
export class CdkTable<T> implements CollectionViewer {

src/demo-app/a11y/a11y.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export class AccessibilityHome {}
1313
templateUrl: 'a11y.html',
1414
styleUrls: ['a11y.css'],
1515
encapsulation: ViewEncapsulation.None,
16+
preserveWhitespaces: false,
1617
})
1718
export class AccessibilityDemo {
1819
@ViewChild('maincontent') mainContent: ElementRef;

src/demo-app/a11y/icon/icon-a11y.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {MdSnackBar} from '@angular/material';
66
selector: 'icon-a11y',
77
templateUrl: 'icon-a11y.html',
88
encapsulation: ViewEncapsulation.None,
9+
preserveWhitespaces: false,
910
})
1011
export class IconAccessibilityDemo {
1112
constructor(private snackBar: MdSnackBar) {}

src/demo-app/autocomplete/autocomplete-demo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export interface StateGroup {
1818
selector: 'autocomplete-demo',
1919
templateUrl: 'autocomplete-demo.html',
2020
styleUrls: ['autocomplete-demo.css'],
21-
encapsulation: ViewEncapsulation.None
21+
encapsulation: ViewEncapsulation.None,
22+
preserveWhitespaces: false,
2223
})
2324
export class AutocompleteDemo {
2425
stateCtrl: FormControl;

src/demo-app/demo-app/demo-app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {OverlayContainer} from '@angular/cdk/overlay';
1717
selector: 'entry-app',
1818
template: '<router-outlet></router-outlet>',
1919
encapsulation: ViewEncapsulation.None,
20+
preserveWhitespaces: false,
2021
})
2122
export class EntryApp {}
2223

@@ -41,6 +42,7 @@ export class Home {}
4142
templateUrl: 'demo-app.html',
4243
styleUrls: ['demo-app.css'],
4344
encapsulation: ViewEncapsulation.None,
45+
preserveWhitespaces: false,
4446
})
4547
export class DemoApp {
4648
dark = false;

src/demo-app/expansion/expansion-demo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {Component, ViewEncapsulation} from '@angular/core';
66
styleUrls: ['expansion-demo.css'],
77
templateUrl: 'expansion-demo.html',
88
encapsulation: ViewEncapsulation.None,
9+
preserveWhitespaces: false,
910
})
1011
export class ExpansionDemo {
1112
displayMode: string = 'default';

src/demo-app/icon/icon-demo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {MdIconRegistry} from '@angular/material';
88
templateUrl: 'icon-demo.html',
99
styleUrls: ['icon-demo.css'],
1010
encapsulation: ViewEncapsulation.None,
11+
preserveWhitespaces: false,
1112
})
1213
export class IconDemo {
1314
constructor(mdIconRegistry: MdIconRegistry, sanitizer: DomSanitizer) {

src/demo-app/overlay/overlay-demo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
templateUrl: 'overlay-demo.html',
2424
styleUrls: ['overlay-demo.css'],
2525
encapsulation: ViewEncapsulation.None,
26+
preserveWhitespaces: false,
2627
})
2728
export class OverlayDemo {
2829
nextPosition: number = 0;

0 commit comments

Comments
 (0)