Skip to content

Commit f52c7f4

Browse files
authored
fix: add camelCase ng-content selectors (#5953)
* fix: add camelCase ng-content selectors * change list.md
1 parent 53e3fd9 commit f52c7f4

File tree

5 files changed

+36
-30
lines changed

5 files changed

+36
-30
lines changed

src/lib/card/card-header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ng-content select="[md-card-avatar], [mat-card-avatar]"></ng-content>
1+
<ng-content select="[md-card-avatar], [mat-card-avatar], [mdCardAvatar], [matCardAvatar]"></ng-content>
22
<div class="mat-card-header-text">
33
<ng-content
44
select="md-card-title, mat-card-title, md-card-subtitle, mat-card-subtitle,

src/lib/grid-list/grid-tile-text.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<ng-content select="[md-grid-avatar], [mat-grid-avatar]"></ng-content>
2-
<div class="mat-grid-list-text"><ng-content select="[md-line], [mat-line]"></ng-content></div>
1+
<ng-content select="[md-grid-avatar], [mat-grid-avatar], [mdGridAvatar], [matGridAvatar]"></ng-content>
2+
<div class="mat-grid-list-text"><ng-content select="[md-line], [mat-line], [mdLine], [matLine]"></ng-content></div>
33
<ng-content></ng-content>

src/lib/list/list-item.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
</div>
66

77
<ng-content
8-
select="[md-list-avatar],[md-list-icon], [mat-list-avatar], [mat-list-icon]"></ng-content>
9-
<div class="mat-list-text"><ng-content select="[md-line], [mat-line]"></ng-content></div>
8+
select="[md-list-avatar], [md-list-icon], [mat-list-avatar], [mat-list-icon],
9+
[mdListAvatar], [mdListIcon], [matListAvatar], [matListIcon]">
10+
</ng-content>
11+
12+
<div class="mat-list-text">
13+
<ng-content select="[md-line], [mat-line], [mdLine], [matLine]"></ng-content>
14+
</div>
15+
1016
<ng-content></ng-content>
1117
</div>

src/lib/list/list.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ element in an `<md-list-item>`.
3434
```html
3535
<md-nav-list>
3636
<md-list-item *ngFor="let link of links">
37-
<a md-line href="...">{{ link }}</a>
37+
<a mdLine href="...">{{ link }}</a>
3838
<button md-icon-button (click)="showInfo(link)">
3939
<md-icon>info</md-icon>
4040
</button>
@@ -43,16 +43,16 @@ element in an `<md-list-item>`.
4343
```
4444

4545
### Multi-line lists
46-
For lists that require multiple lines per item, annotate each line with an `md-line` attribute.
46+
For lists that require multiple lines per item, annotate each line with an `mdLine` attribute.
4747
Whichever heading tag is appropriate for your DOM hierarchy should be used (not necessarily `<h3>`
4848
as shown in the example).
4949

5050
```html
5151
<!-- two line list -->
5252
<md-list>
5353
<md-list-item *ngFor="let message of messages">
54-
<h3 md-line> {{message.from}} </h3>
55-
<p md-line>
54+
<h3 mdLine> {{message.from}} </h3>
55+
<p mdLine>
5656
<span> {{message.subject}} </span>
5757
<span class="demo-2"> -- {{message.content}} </span>
5858
</p>
@@ -62,24 +62,24 @@ as shown in the example).
6262
<!-- three line list -->
6363
<md-list>
6464
<md-list-item *ngFor="let message of messages">
65-
<h3 md-line> {{message.from}} </h3>
66-
<p md-line> {{message.subject}} </p>
67-
<p md-line class="demo-2"> {{message.content}} </p>
65+
<h3 mdLine> {{message.from}} </h3>
66+
<p mdLine> {{message.subject}} </p>
67+
<p mdLine class="demo-2"> {{message.content}} </p>
6868
</md-list-item>
6969
</md-list>
7070
```
7171

7272
### Lists with icons
7373

74-
To add an icon to your list item, use the `md-list-icon` attribute.
74+
To add an icon to your list item, use the `mdListIcon` attribute.
7575

7676

7777
```html
7878
<md-list>
7979
<md-list-item *ngFor="let message of messages">
80-
<md-icon md-list-icon>folder</md-icon>
81-
<h3 md-line> {{message.from}} </h3>
82-
<p md-line>
80+
<md-icon mdListIcon>folder</md-icon>
81+
<h3 mdLine> {{message.from}} </h3>
82+
<p mdLine>
8383
<span> {{message.subject}} </span>
8484
<span class="demo-2"> -- {{message.content}} </span>
8585
</p>
@@ -89,14 +89,14 @@ To add an icon to your list item, use the `md-list-icon` attribute.
8989

9090
### Lists with avatars
9191

92-
To include an avatar image, add an image tag with an `md-list-avatar` attribute.
92+
To include an avatar image, add an image tag with an `mdListAvatar` attribute.
9393

9494
```html
9595
<md-list>
9696
<md-list-item *ngFor="let message of messages">
97-
<img md-list-avatar src="..." alt="...">
98-
<h3 md-line> {{message.from}} </h3>
99-
<p md-line>
97+
<img mdListAvatar src="..." alt="...">
98+
<h3 mdLine> {{message.from}} </h3>
99+
<p mdLine>
100100
<span> {{message.subject}} </span>
101101
<span class="demo-2"> -- {{message.content}} </span>
102102
</p>
@@ -121,23 +121,23 @@ to the main `md-list` tag.
121121

122122
### Lists with multiple sections
123123

124-
Subheader can be added to a list by annotating a heading tag with an `md-subheader` attribute.
124+
Subheader can be added to a list by annotating a heading tag with an `mdSubheader` attribute.
125125
To add a divider, use `<md-divider>`.
126126

127127
```html
128128
<md-list>
129-
<h3 md-subheader>Folders</h3>
129+
<h3 mdSubheader>Folders</h3>
130130
<md-list-item *ngFor="let folder of folders">
131-
<md-icon md-list-icon>folder</md-icon>
132-
<h4 md-line>{{folder.name}}</h4>
133-
<p md-line class="demo-2"> {{folder.updated}} </p>
131+
<md-icon mdListIcon>folder</md-icon>
132+
<h4 mdLine>{{folder.name}}</h4>
133+
<p mdLine class="demo-2"> {{folder.updated}} </p>
134134
</md-list-item>
135135
<md-divider></md-divider>
136-
<h3 md-subheader>Notes</h3>
136+
<h3 mdSubheader>Notes</h3>
137137
<md-list-item *ngFor="let note of notes">
138-
<md-icon md-list-icon>note</md-icon>
139-
<h4 md-line>{{note.name}}</h4>
140-
<p md-line class="demo-2"> {{note.updated}} </p>
138+
<md-icon mdListIcon>note</md-icon>
139+
<h4 mdLine>{{note.name}}</h4>
140+
<p mdLine class="demo-2"> {{note.updated}} </p>
141141
</md-list-item>
142142
</md-list>
143143
```

src/lib/list/list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class MdListIconCssMatStyler {}
108108
* @docs-private
109109
*/
110110
@Directive({
111-
selector: '[md-subheader], [mat-subheader]',
111+
selector: '[md-subheader], [mat-subheader], [mdSubheader], [matSubheader]',
112112
host: {'class': 'mat-subheader'}
113113
})
114114
export class MdListSubheaderCssMatStyler {}

0 commit comments

Comments
 (0)