angular5 - 角度 5 Material MatTableDataSource

标签 angular5

我从角度 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 ...

你能帮帮我吗?

最佳答案

MatTableDataSourceMatTable已经在MatTableModule中,所以不需要在@NgModule中再次导入。

从您的共享 -> 导入中删除 MatTableDataSource

仅将其导入您的组件中,作为 import { MatTableDataSource} from @angular/material

关于angular5 - 角度 5 Material MatTableDataSource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47204805/

相关文章:

datetimepicker - NgPickDateTime 显示军用时间

Angular 解析函数依赖于其他解析器

javascript - 遇到恼人的问题 : momentjs taking a day off by 1 with mat-datepicker for different timezones?

angular - 获取错误 ../node_modules/rxjs/Rx "' has no exported member ' of'

angular-material - 'mat-expansion-panel' 在以 Angular 5 进行生产构建时不是已知元素

angular - 如何在 Angular 5 中从 http 重定向到 https?

html - 如何制作结构指令来包装我的 DOM 的一部分?

angular - 如何在 Angular 5 中使用拼接

javascript - ckeditor - 获取最后一个光标位置并在该 Angular 5 处附加 html

javascript - 如何在 Angular2 中将组件的 html 设置为 iframe