app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
colors = [
"Red", "Green", "Blue", "Yellow",
"Black", "Magenta", "Pink"
];
}
app.component.html
<h2 style="padding-top:25px; padding-bottom:16px;">
Angular Material - How to generate List items from an array
</h2>
<mat-list *ngFor="let color of colors">
<mat-list-item>
{{color}}
</mat-list-item>
</mat-list>
app.module.ts [import]
import { MatListModule } from '@angular/material/list'
- angular material - Tick interval with step in Slider
- angular material - How to use Slider input event
- angular material - How to use Slide toggle
- 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 - 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
- angular material - List items separator
- angular material - How to use List dense layout mode
- angular material - How to use Navigation List