Unable to load the POPUP in angular using angular material

别等时光非礼了梦想. 提交于 2019-12-31 03:57:05

问题


I have created a sample stackblitz demo implementing a simple angular material table in the popup component.

I have also taken an empty table where I am pushing the selected table rows from my first table to second empty table.

But the problem is here I am unable to run the stackblitz example, I tried out various ways to fix the issue but I am unable to find the solution.

Can anybody please help me out in resolving the issue "popup undefined"

And also when I am transferring table rows to the empty table , I am unable to select the checkbox in the second table to remove them back in the first table.

Please access my sample demo here.

Below shown is the screenshot of the error.


回答1:


Import your dialog module separately

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

instead of

import {MatDialogModule,...,...} from '@angular/material';

Working link : https://stackblitz.com/edit/angular-table-data-swap-y7sbxp?file=main.ts




回答2:


You have not imported OpenPopup in your main.ts.

Make the following changes

main.ts:

Import {TableComponent,OpenPopup} from './path'

tableComponent.component.ts

import { MAT_DIALOG_DATA, MatDialogRef, MatDialog } from '@angular/material';



来源:https://stackoverflow.com/questions/52968040/unable-to-load-the-popup-in-angular-using-angular-material

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!