我从棱角4.4.6和材料beta 19更新到角5和材料5.0.0-rc0
应用程序正确编译,但我在Chrome上执行
“Uncaught Error:模块'Material Modules'导入的意外值'MatTable DataSource' . 请添加@NgModule注释 . ”
其他材料组件正常工作,mat-icon,mat-card-content,mat-tab-group,mat-dialog-xxx ...
你可以帮帮我吗?
MatTableDataSource位于主分支中,但未添加到当前版本 .
我希望这个链接可以帮助您使用模块“@ angular / cdk / collections”中的Abstract类“DataSource”创建自己的数据源 .
https://github.com/angular/material2/issues/6036
MatTableDataSource , MatTable 已经在 MatTableModule 中,因此无需在 @NgModule 中再次导入它 .
MatTableDataSource
MatTable
MatTableModule
@NgModule
Remove MatTableDataSource from your shared -> import
仅将其作为 import { MatTableDataSource} from @angular/material 导入到您的组件中;
import { MatTableDataSource} from @angular/material
导入模块并在@NgModule Imports部分输入 . 这可能在你的something.module.ts中 .
升级到Angular 5之后我遇到了类似的问题,更新了所有依赖关系,如typescript,corejs,angular-cli等,最新版本解决了这个问题 .
4 回答
MatTableDataSource位于主分支中,但未添加到当前版本 .
我希望这个链接可以帮助您使用模块“@ angular / cdk / collections”中的Abstract类“DataSource”创建自己的数据源 .
https://github.com/angular/material2/issues/6036
MatTableDataSource
,MatTable
已经在MatTableModule
中,因此无需在@NgModule
中再次导入它 .Remove MatTableDataSource from your shared -> import
仅将其作为
import { MatTableDataSource} from @angular/material
导入到您的组件中;导入模块并在@NgModule Imports部分输入 . 这可能在你的something.module.ts中 .
升级到Angular 5之后我遇到了类似的问题,更新了所有依赖关系,如typescript,corejs,angular-cli等,最新版本解决了这个问题 .