Skip to content

Commit a200024

Browse files
willshowellkara
authored andcommitted
feat(card): allow md-card-title and subtitle to be used as attributes (#4122)
1 parent 7de316f commit a200024

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/lib/card/card-header.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<ng-content select="[md-card-avatar], [mat-card-avatar]"></ng-content>
22
<div class="mat-card-header-text">
33
<ng-content
4-
select="md-card-title, mat-card-title, md-card-subtitle, mat-card-subtitle"></ng-content>
4+
select="md-card-title, mat-card-title, md-card-subtitle, mat-card-subtitle,
5+
[md-card-title], [mat-card-title], [md-card-subtitle], [mat-card-subtitle]"></ng-content>
56
</div>
67
<ng-content></ng-content>

src/lib/card/card-title-group.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<div>
22
<ng-content
3-
select="md-card-title, mat-card-title, md-card-subtitle, mat-card-subtitle"></ng-content>
3+
select="md-card-title, mat-card-title, md-card-subtitle, mat-card-subtitle,
4+
[md-card-title], [mat-card-title], [md-card-subtitle], [mat-card-subtitle]"></ng-content>
45
</div>
56
<ng-content select="img"></ng-content>
67
<ng-content></ng-content>

src/lib/card/card.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class MdCardContent {}
2323
* @docs-private
2424
*/
2525
@Directive({
26-
selector: 'md-card-title, mat-card-title',
26+
selector: 'md-card-title, mat-card-title, [md-card-title], [mat-card-title]',
2727
host: {
2828
'[class.mat-card-title]': 'true'
2929
}
@@ -35,7 +35,7 @@ export class MdCardTitle {}
3535
* @docs-private
3636
*/
3737
@Directive({
38-
selector: 'md-card-subtitle, mat-card-subtitle',
38+
selector: 'md-card-subtitle, mat-card-subtitle, [md-card-subtitle], [mat-card-subtitle]',
3939
host: {
4040
'[class.mat-card-subtitle]': 'true'
4141
}

src/lib/core/compatibility/compatibility.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export class MdCompatibilityInvalidPrefixError extends MdError {
3232
/** Selector that matches all elements that may have style collisions with AngularJS Material. */
3333
export const MAT_ELEMENTS_SELECTOR = `
3434
[mat-button],
35+
[mat-card-subtitle],
36+
[mat-card-title],
3537
[mat-dialog-actions],
3638
[mat-dialog-close],
3739
[mat-dialog-content],
@@ -92,6 +94,8 @@ export const MAT_ELEMENTS_SELECTOR = `
9294
/** Selector that matches all elements that may have style collisions with AngularJS Material. */
9395
export const MD_ELEMENTS_SELECTOR = `
9496
[md-button],
97+
[md-card-subtitle],
98+
[md-card-title],
9599
[md-dialog-actions],
96100
[md-dialog-close],
97101
[md-dialog-content],

0 commit comments

Comments
 (0)