app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
message:string = "";
onDelete(){
this.message = "Delete action list item clicked.";
}
onRestore(){
this.message = "Restore action list item clicked.";
}
onDownload(){
this.message = "Download action list item clicked.";
}
onUpload(){
this.message = "Upload action list item clicked.";
}
}
app.component.html
<h2 style="padding-top:25px; padding-bottom:16px;">
Angular Material - How to use Action List
</h2>
<h3>{{message}}</h3>
<mat-action-list>
<button mat-list-item (click)="onDelete()">
Delete
</button>
<button mat-list-item (click)="onRestore()">
Restore
</button>
<button mat-list-item (click)="onDownload()">
Download
</button>
<button mat-list-item (click)="onUpload()">
Upload
</button>
</mat-action-list>
app.module.ts [import]
import { MatListModule } from '@angular/material/list'
import { MatButtonModule } from '@angular/material/button'
- angular material - How to change Badge position
- angular material - How to toggle Badge visibility
- angular material - Action bar inside an Expansion Panel
- angular material - Expansion Panel opened & closed event
- angular material - How to use Accordion flat display mode
- angular material - Open & close Expansion Panel on button click
- angular material - Expansion Panel afterExpand & afterCollapse event
- angular material - How to initially expand Expansion Panel
- angular material - Expansion Panel header expanded background color
- angular material - Accordion expanded panels header background color
- angular material - How to use List dense layout mode
- angular material - How to use Navigation List
- angular material - Navigation list with button and icon
- angular material - Action list with button and icon
- angular material - How to use Selection List