Skip to content

Commit a402b5e

Browse files
committed
build: make material-examples compatible with ivy template type checking
1 parent 99a96d5 commit a402b5e

File tree

17 files changed

+39
-22
lines changed

17 files changed

+39
-22
lines changed

src/material-examples/autocomplete-auto-active-first-option/autocomplete-auto-active-first-option-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<mat-form-field class="example-full-width">
33
<input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="myControl" [matAutocomplete]="auto">
44
<mat-autocomplete autoActiveFirstOption #auto="matAutocomplete">
5-
<mat-option *ngFor="let option of filteredOptions | async" [value]="option">
5+
<mat-option *ngFor="let option of (filteredOptions | async)!" [value]="option">
66
{{option}}
77
</mat-option>
88
</mat-autocomplete>

src/material-examples/autocomplete-display/autocomplete-display-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<mat-form-field class="example-full-width">
33
<input type="text" placeholder="Assignee" aria-label="Assignee" matInput [formControl]="myControl" [matAutocomplete]="auto">
44
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn">
5-
<mat-option *ngFor="let option of filteredOptions | async" [value]="option">
5+
<mat-option *ngFor="let option of (filteredOptions | async)!" [value]="option">
66
{{option.name}}
77
</mat-option>
88
</mat-autocomplete>

src/material-examples/autocomplete-display/autocomplete-display-example.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export class AutocompleteDisplayExample implements OnInit {
3333
);
3434
}
3535

36-
displayFn(user?: User): string | undefined {
37-
return user ? user.name : undefined;
36+
displayFn(user: User): string {
37+
return user.name;
3838
}
3939

4040
private _filter(name: string): User[] {

src/material-examples/autocomplete-filter/autocomplete-filter-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<mat-form-field class="example-full-width">
33
<input type="text" placeholder="Pick one" aria-label="Number" matInput [formControl]="myControl" [matAutocomplete]="auto">
44
<mat-autocomplete #auto="matAutocomplete">
5-
<mat-option *ngFor="let option of filteredOptions | async" [value]="option">
5+
<mat-option *ngFor="let option of (filteredOptions | async)!" [value]="option">
66
{{option}}
77
</mat-option>
88
</mat-autocomplete>

src/material-examples/autocomplete-optgroup/autocomplete-optgroup-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<mat-form-field>
33
<input type="text" matInput placeholder="States Group" formControlName="stateGroup" required [matAutocomplete]="autoGroup">
44
<mat-autocomplete #autoGroup="matAutocomplete">
5-
<mat-optgroup *ngFor="let group of stateGroupOptions | async" [label]="group.letter">
5+
<mat-optgroup *ngFor="let group of (stateGroupOptions | async)!" [label]="group.letter">
66
<mat-option *ngFor="let name of group.names" [value]="name">
77
{{name}}
88
</mat-option>

src/material-examples/autocomplete-overview/autocomplete-overview-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<mat-form-field class="example-full-width">
33
<input matInput placeholder="State" aria-label="State" [matAutocomplete]="auto" [formControl]="stateCtrl">
44
<mat-autocomplete #auto="matAutocomplete">
5-
<mat-option *ngFor="let state of filteredStates | async" [value]="state.name">
5+
<mat-option *ngFor="let state of (filteredStates | async)!" [value]="state.name">
66
<img class="example-option-img" aria-hidden [src]="state.flag" height="25">
77
<span>{{state.name}}</span> |
88
<small>Population: {{state.population}}</small>

src/material-examples/autocomplete-plain-input/autocomplete-plain-input-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<form class="example-form">
22
<input type="text" placeholder="Search for a street" [formControl]="control" [matAutocomplete]="auto">
33
<mat-autocomplete #auto="matAutocomplete">
4-
<mat-option *ngFor="let street of filteredStreets | async" [value]="street">
4+
<mat-option *ngFor="let street of (filteredStreets | async)!" [value]="street">
55
{{street}}
66
</mat-option>
77
</mat-autocomplete>

src/material-examples/cdk-custom-stepper-without-form/example-custom-stepper.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ <h2>Step {{ selectedIndex + 1 }}/{{ steps.length }}</h2>
1111
<button class="example-nav-button" cdkStepperPrevious>&larr;</button>
1212
<button
1313
class="example-step"
14-
*ngFor="let step of steps; let i = index"
14+
*ngFor="let step of steps.toArray(); let i = index"
1515
[ngClass]="{ 'example-active': selectedIndex === i }"
1616
(click)="onClick(i)"
1717
>

src/material-examples/checkbox-configurable/checkbox-configurable-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ import {Component} from '@angular/core';
1111
export class CheckboxConfigurableExample {
1212
checked = false;
1313
indeterminate = false;
14-
labelPosition = 'after';
14+
labelPosition: 'after'|'before' = 'after';
1515
disabled = false;
1616
}

src/material-examples/chips-autocomplete/chips-autocomplete-example.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
(matChipInputTokenEnd)="add($event)">
2020
</mat-chip-list>
2121
<mat-autocomplete #auto="matAutocomplete" (optionSelected)="selected($event)">
22-
<mat-option *ngFor="let fruit of filteredFruits | async" [value]="fruit">
22+
<mat-option *ngFor="let fruit of (filteredFruits | async)!" [value]="fruit">
2323
{{fruit}}
2424
</mat-option>
2525
</mat-autocomplete>

0 commit comments

Comments
 (0)