Member-only story
Angular Material — Dialogs, Dividers, and Expansion Panels
3 min readJan 19, 2021
Angular Material is a popular UI framework based on Material Design for Angular.
In this article, we’ll look at how to use Angular Material into our Angular project.
Dialog
Angular Material has a dialog component.
For example, we can write:
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatDialogModule } from '@angular/material/dialog';
import { MatButtonModule } from '@angular/material/button'@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
MatDialogModule,
MatButtonModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app.component.ts
import { Component } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';@Component({
selector: 'dialog-content-example-dialog',
template…