谢谢
MaterialModule has been removed and is no longer available. As noted
in the changelog for beta.3,an aggregate module like MaterialModule
prevents tools from being able to treeshake unused components and
modules.
此外,使用2.0.0-beta.11及更高版本,将角度版本更新为4.4.3或更高版本. Material 2.0.0-beta.11取决于4.4.3或更高版本.对于CHANGELOG来说:
Breaking changes
Angular Material now requires Angular 4.4.3 or greater
现在您有两种选择:
> Dowgrade为2.0.0-beta.10
>包括单个材料组件模块,以便在您的应用中使用它们.
在第二种情况下,
import { MatSelectModule,MatButtonModule } from '@angular/material'; ... imports: [ .... MatSelectModule,MatButtonModule ]
最后,请记住,自2.0.0-beta.12以来,Md前缀已被删除,您应该在任何地方都使用Mat前缀.来自2.0.0-beta.11的CHANGELOG:
For beta.11,we’ve made the decision to deprecate the “md” prefix
completely and use “mat” moving forward. This affects all class names,
properties,inputs,outputs,and selectors (CSS classes were changed
back in February). The “md” prefixes will be removed in the next beta
release.
从2.0.0-beta.12的CHANGELOG:
Breaking Changes
All “md” prefixes have been removed.
请参阅此工作StackBlitz demo与单个材料模块和使用Mat前缀.