Skip to content

Commit

Permalink
fix(card): unable to bind to align attribute (#5495)
Browse files Browse the repository at this point in the history
Fixes not being able to bind to the `align` attribute on the `md-card-actions`.

Fixes #5490.
  • Loading branch information
crisbeto authored and jelbourn committed Jul 14, 2017
1 parent d04230c commit 243b97d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/lib/card/card.scss
Expand Up @@ -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 {
Expand Down
13 changes: 10 additions & 3 deletions src/lib/card/card.ts
Expand Up @@ -10,7 +10,8 @@ import {
Component,
ViewEncapsulation,
ChangeDetectionStrategy,
Directive
Directive,
Input,
} from '@angular/core';


Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 243b97d

Please sign in to comment.