fix(card): unable to bind to align attribute (#5495)

Fixes not being able to bind to the `align` attribute on the `md-card-actions`.

Fixes #5490.
This commit is contained in:
Kristiyan Kostadinov
2017-07-14 02:12:29 +02:00
committed by Jeremy Elbourn
parent d04230c084
commit 243b97dfb0
2 changed files with 14 additions and 7 deletions
+4 -4
View File
@@ -43,11 +43,11 @@ $mat-card-header-size: 40px !default;
margin-left: -16px;
margin-right: -16px;
padding: 8px 0;
}
&[align='end'] {
display: flex;
justify-content: flex-end;
}
.mat-card-actions-align-end {
display: flex;
justify-content: flex-end;
}
.mat-card-image {
+10 -3
View File
@@ -10,7 +10,8 @@ import {
Component,
ViewEncapsulation,
ChangeDetectionStrategy,
Directive
Directive,
Input,
} from '@angular/core';
@@ -56,9 +57,15 @@ export class MdCardSubtitle {}
*/
@Directive({
selector: 'md-card-actions, mat-card-actions',
host: {'class': 'mat-card-actions'}
host: {
'class': 'mat-card-actions',
'[class.mat-card-actions-align-end]': 'align === "end"',
}
})
export class MdCardActions {}
export class MdCardActions {
/** Position of the actions inside the card. */
@Input() align: 'start' | 'end' = 'start';
}
/**
* Footer of a card, needed as it's used as a selector in the API.