我从角度 4.4.6 和 Material beta 19 更新到角度 5 和 Material 5.0.0-rc0
应用程序编译正确,但我在 Chrome 上执行
"Uncaught Error: Unexpected value 'MatTable DataSource' imported by the module 'Material Modules'. Please add a @NgModule annotation."
其他 Material 组件工作正常,mat-icon,mat-card-content,mat-tab-group,mat-dialog-xxx ...
你能帮帮我吗?
最佳答案
MatTableDataSource
、MatTable
已经在MatTableModule
中,所以不需要在@NgModule
中再次导入。
从您的共享 -> 导入中删除 MatTableDataSource
仅将其导入您的组件中,作为 import { MatTableDataSource} from @angular/material
;
关于angular5 - 角度 5 Material MatTableDataSource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47204805/