StaticInjectorError (AppModule) [ProjectListComponent-> MdDialog]

using MdDialog to report errors, do you need dependency injection in AppModule?

TS code snippet:

import { MdDialog } from "@angular/material";

constructor(private dialog: MdDialog) { }

openNewProjectDialog() {
    this.dialog.open(NewProjectComponent);
}

error prompt:

`core.js:1449 ERROR Error: Uncaught (in promise): Error: StaticInjectorError (AppModule) [ProjectListComponent-> MdDialog]:
StaticInjectorError (Platform: core) [ProjectListComponent-> MdDialog]:

NullInjectorError: No provider for MdDialog!

Error: StaticInjectorError (AppModule) [ProjectListComponent-> MdDialog]:
StaticInjectorError (Platform: core) [ProjectListComponent-> MdDialog]:

NullInjectorError: No provider for MdDialog!`
Mar.28,2021

import {MatDialogModule} from'@ angular/material/dialog'

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b4bb-34631.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b4bb-34631.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?