angular - wrapping angular2 material md-button inside a custom button -
i'm trying wrap material md-button inside custom-button , passing along the type of button want render via attribute. attribute gets passed along late in rendering pipeline material styles being applied.
@component({ selector: 'custom-button', template: ` <button [attr.md-raised-button]="israisedbutton()"> <ng-content></ng-content> </button>`, directives: [md_button_directives] }) export class custombutton { @input('raised-button') public raisedbutton: boolean = null; public israisedbutton(): string { return (this.raisedbutton != null && this.raisedbutton != false) ? '' : null; } }
my used this.
<custom-button raised-button>button text</custom-button>
as said attributes gets added button not rendered material raised input.
any appreciated.
Comments
Post a Comment