Skip to content

Commit 9150177

Browse files
authored
docs(material/dialog): use element selector instead of attribute selector (#28517)
Because the element selector is: - at least as much semantically correct as the div used until now - more expressive - by far the most used in this repository - the only selector explicitly mentioned on https://material.angular.io/components/dialog/overview#dialog-content
1 parent 58764af commit 9150177

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<h1 mat-dialog-title>Delete file</h1>
2-
<div mat-dialog-content>
2+
<mat-dialog-content>
33
Would you like to delete cat.jpeg?
4-
</div>
5-
<div mat-dialog-actions>
4+
</mat-dialog-content>
5+
<mat-dialog-actions>
66
<button mat-button mat-dialog-close>No</button>
77
<button mat-button mat-dialog-close cdkFocusInitial>Ok</button>
8-
</div>
8+
</mat-dialog-actions>

src/components-examples/material/dialog/dialog-data/dialog-data-example-dialog.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1 mat-dialog-title>Favorite Animal</h1>
2-
<div mat-dialog-content>
2+
<mat-dialog-content>
33
My favorite animal is:
44
<ul>
55
<li>
@@ -18,4 +18,4 @@ <h1 mat-dialog-title>Favorite Animal</h1>
1818
} Lion
1919
</li>
2020
</ul>
21-
</div>
21+
</mat-dialog-content>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1 mat-dialog-title>Dialog with elements</h1>
2-
<div mat-dialog-content>This dialog showcases the title, close, content and actions elements.</div>
3-
<div mat-dialog-actions>
2+
<mat-dialog-content>This dialog showcases the title, close, content and actions elements.</mat-dialog-content>
3+
<mat-dialog-actions>
44
<button mat-button mat-dialog-close>Close</button>
5-
</div>
5+
</mat-dialog-actions>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<h1 mat-dialog-title>Hi {{data.name}}</h1>
2-
<div mat-dialog-content>
2+
<mat-dialog-content>
33
<p>What's your favorite animal?</p>
44
<mat-form-field>
55
<mat-label>Favorite Animal</mat-label>
66
<input matInput [(ngModel)]="data.animal">
77
</mat-form-field>
8-
</div>
9-
<div mat-dialog-actions>
8+
</mat-dialog-content>
9+
<mat-dialog-actions>
1010
<button mat-button (click)="onNoClick()">No Thanks</button>
1111
<button mat-button [mat-dialog-close]="data.animal" cdkFocusInitial>Ok</button>
12-
</div>
12+
</mat-dialog-actions>

src/dev-app/slider/slider-demo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ export class SliderDemo {
124124
styleUrls: ['slider-demo.css'],
125125
template: `
126126
<h1 mat-dialog-title>Slider in a dialog</h1>
127-
<div class="demo-dialog-content" mat-dialog-content>
127+
<mat-dialog-content class="demo-dialog-content">
128128
<mat-slider [discrete]="this.data.discrete" [showTickMarks]="this.data.showTickMarks" [color]="this.data.color" step="10">
129129
<input value="50" matSliderThumb>
130130
</mat-slider>
131131
<mat-slider [discrete]="this.data.discrete" [showTickMarks]="this.data.showTickMarks" [color]="this.data.color" step="10">
132132
<input value="30" matSliderStartThumb>
133133
<input value="70" matSliderEndThumb>
134134
</mat-slider>
135-
</div>
135+
</mat-dialog-content>
136136
`,
137137
standalone: true,
138138
imports: [MatSliderModule, MatDialogTitle, MatDialogContent],

0 commit comments

Comments
 (0)