Mostafa Farhani
Mostafa Farhani

Reputation: 345

How to set attributes dynamically in angular?

I am using angular material and ngx-form-schema in an angular 7 project. How can create a directive to handle all type of mat buttons? I want to send type of mat button such 'mat-flat-button' or 'mat-raised-button' to that directive then the directive show that mat button.

Upvotes: 0

Views: 1126

Answers (1)

Dániel Barta
Dániel Barta

Reputation: 1062

Create two buttons. One with mat-flat-button, one with mat-raised-button. Then use *ngIf or ngSwitch to display only one at a time.

Upvotes: 2

Related Questions