Skip to content

Commit 2c4e2af

Browse files
authored
build: enable all ngtsc strictness flags (#18339)
Re-enables the `strictDomLocalRefTypes` and `strictDomEventTypes`, fixes a few legitimate failures and works around the rest.
1 parent dfb3e05 commit 2c4e2af

File tree

9 files changed

+15
-11
lines changed

9 files changed

+15
-11
lines changed

src/components-examples/material/select/select-initial-value/select-initial-value-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h4>Basic mat-select with initial value</h4>
1111
<h4>Basic native select with initial value</h4>
1212
<mat-form-field>
1313
<mat-label>Favorite Car</mat-label>
14-
<select matNativeControl (change)="selectedCar = $event.target.value">
14+
<select matNativeControl (change)="selectCar($event)">
1515
<option value=""></option>
1616
<option *ngFor="let option of cars" [value]="option.value"
1717
[selected]="selectedCar === option.value">{{ option.viewValue }}</option>

src/components-examples/material/select/select-initial-value/select-initial-value-example.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,8 @@ export class SelectInitialValueExample {
3131
];
3232
selectedFood = this.foods[2].value;
3333
selectedCar = this.cars[0].value;
34+
35+
selectCar(event: Event) {
36+
this.selectedCar = (event.target as HTMLSelectElement).value;
37+
}
3438
}

src/components-examples/material/table/table-filtering/table-filtering-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<mat-form-field>
22
<mat-label>Filter</mat-label>
3-
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Ex. ium">
3+
<input matInput (keyup)="applyFilter($event)" placeholder="Ex. ium">
44
</mat-form-field>
55

66
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">

src/components-examples/material/table/table-filtering/table-filtering-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export class TableFilteringExample {
3333
displayedColumns: string[] = ['position', 'name', 'weight', 'symbol'];
3434
dataSource = new MatTableDataSource(ELEMENT_DATA);
3535

36-
applyFilter(filterValue: string) {
36+
applyFilter(event: Event) {
37+
const filterValue = (event.target as HTMLInputElement).value;
3738
this.dataSource.filter = filterValue.trim().toLowerCase();
3839
}
3940
}

src/components-examples/material/table/table-overview/table-overview-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<mat-form-field>
22
<mat-label>Filter</mat-label>
3-
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Ex. Mia">
3+
<input matInput (keyup)="applyFilter($event)" placeholder="Ex. Mia">
44
</mat-form-field>
55

66
<div class="mat-elevation-z8">

src/components-examples/material/table/table-overview/table-overview-example.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export class TableOverviewExample implements OnInit {
4848
this.dataSource.sort = this.sort;
4949
}
5050

51-
applyFilter(filterValue: string) {
51+
applyFilter(event: Event) {
52+
const filterValue = (event.target as HTMLInputElement).value;
5253
this.dataSource.filter = filterValue.trim().toLowerCase();
5354

5455
if (this.dataSource.paginator) {

src/dev-app/select/select-demo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ <h4>Error message with errorStateMatcher</h4>
398398
<mat-card-content>
399399
<mat-form-field>
400400
<mat-label>Starter pokemon</mat-label>
401-
<mat-select (change)="latestChangeEvent = $event">
401+
<mat-select (selectionChange)="latestChangeEvent = $event">
402402
<mat-option *ngFor="let creature of pokemon" [value]="creature.value">{{ creature.viewValue }}</mat-option>
403403
</mat-select>
404404
</mat-form-field>

src/e2e-app/radio/radio-e2e.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<section>
22
<mat-radio-group [disabled]="isGroupDisabled"
3-
[(value)]="groupValue"
3+
[value]="groupValue"
44
id="test-group" aria-label="Select a Pokemon">
55

66
<mat-radio-button value="fire" id="fire">Charmander</mat-radio-button>

tools/bazel/postinstall-patches.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const fs = require('fs');
1212
* Version of the post install patch. Needs to be incremented when
1313
* existing patches or edits have been modified.
1414
*/
15-
const PATCH_VERSION = 2;
15+
const PATCH_VERSION = 3;
1616

1717
/** Path to the project directory. */
1818
const projectDir = path.join(__dirname, '../..');
@@ -114,9 +114,7 @@ searchAndReplace(`[formatProperty + "_ivy_ngcc"]`, '[formatProperty]',
114114

115115
// Workaround for https://github.com/angular/angular/issues/33452:
116116
searchAndReplace(/angular_compiler_options = {/, `$&
117-
"strictTemplates": True,
118-
"strictDomLocalRefTypes ": False,
119-
"strictDomEventTypes": False,`, 'node_modules/@angular/bazel/src/ng_module.bzl');
117+
"strictTemplates": True,`, 'node_modules/@angular/bazel/src/ng_module.bzl');
120118

121119
// More info in https://github.com/angular/angular/pull/33786
122120
shelljs.rm('-rf', [

0 commit comments

Comments
 (0)