Angular开发,报错提示 NG8001: 'mat-dialog-actions' is not a known element,在html中确实有这个:
<mat-dialog-actions align="end">
...
</mat-dialog-actions>
虽然在业务类device.component.ts中定义了对话框的类 EditDeviceDlg,但是并没有在app.module.ts中声明。
@Component({...})
export class DeviceComponent implements OnInit {...}
@Component({
selector: 'edit',
templateUrl: './dlg/edit.html',
})
export class EditDeviceDlg {} //对话框的class
所以要在app.module.ts中声明:
import { EditDeviceDlg } from './device/device.component';
...
@NgModule({
declarations: [
...
EditDeviceDlg
],
...
问题解决。