Question: I am working in angular. My problem is when the button type is "save" means it has to perform some function and if it is "update" means,it has to perform some function.

```
<button mat-flat-button color="primary" (click)="Editappaware info(drawer)" > 
  {{button type}}
</button>

```

Answer: 
Try like this:

**[Working Demo](https://stackblitz.com/edit/mat-button-8fpjmf?embed=1&file=src/app/app.component.html)**

```
<button mat-flat-button color="primary" (click)="buttonType == 'save' ? save() : update()">{{buttonType}}</button>

```
```
<button mat-flat-button color="primary" (click)="onAction( buttonType )" >{{buttonType}}</button>

```

// in component.ts

```
onAction( type: 'save' | 'update'){
  type ==='save' ? create() : update();
}

```