Export materialmodule not found in angular / material

I installed the https://github.com/isaacplmann/ngx-tour module and integrated as recommended, but I get export materialmodule was not found in angular/material and other similar errors when starting npm or building. what could be the problem here and how to solve it. I already checked the packages and they are all installed.

thanks

+5
source share
3 answers

MaterialModule depreciated in version 2.0.0-beta.3 and completely removed in version 2.0.0-beta.11 . See CHANGELOG for more details. Please go to the changes.

MaterialModule has been removed and is no longer available. As stated in the changelog for beta 3, an aggregate module such as the MaterialModule prevents tools from cracking unused components and modules.

Also, with 2.0.0-beta.11 and higher, upgrade angular to 4.4.3 or greater. Material 2.0.0-beta.11 dependent on 4.4.3 or more. Feom the CHANGELOG:

Breaking Angular Changes Material now requires angular 4.4.3 or greater

You now have two options:

  • Dowgrade - 2.0.0-beta.10
  • Include the individual components of the material components to use in your application.

In the second case

 import { MatSelectModule, MatButtonModule } from '@angular/material'; ... imports: [ .... MatSelectModule, ‎MatButtonModule ] 

Finally, remember that with 2.0.0-beta.12 the Md prefix has been removed, and you should use the Mat prefix everywhere. From CHANGELOG 2.0.0-beta.11 :

For beta .11, we decided to abandon the prefix "md" completely and use the "mat", moving forward. This affects all class names, properties, inputs, outputs and selectors (CSS classes changed in February). The "md" prefixes will be removed in the next beta release.

And from CHANGELOG 2.0.0-beta.12 :

Violation of changes All prefixes "md" are removed.

Watch this working demo of StackBlitz with individual material modules and using the Mat prefix.

+4
source

Well, the module is missing . Or you switch to "@angular/material": "2.0.0-beta.10" as @yurzui suggested.

Or - better - just don't use it in your AppModule. Just import the modules of interest, such as MatButtonModule (because even MdButtonModule deprecated).

+3
source

Replace MdCardModule, MdMenuModule, MdToolbarModule, MdIconModule, etc. in the import, if not all, but most of them are changed, and the keyword Md Matte is replaced, i.e. MatSelectModule, MatCardModule, MatMenuModule, etc. Thanks for the answers above. They had reasons. I have a short answer .. safe greeting time.

0
source

Source: https://habr.com/ru/post/1272430/


All Articles