Corner material Configuration Error and warning Please help me sort it out

Corner material 2 using Kli. When I install @ angular / material and include it in app.module, the compiler through 3 warnings.

What I've done

npm install --save @ corner / stuff

other imports

import { MaterialModule } from '@angular/material'; @NgModule({ declarations: [ AppComponent ], imports: [ MaterialModule.forRoot(),other imports... ], providers: [], bootstrap: [AppComponent] }) export class AppModule { } 

Additional settings

styles.css

 @import ' ~@angular /material/core/theming/prebuilt/deeppurple-amber.css'; 

index.html

  <script src="https://ajax.googleapis.com/ajax/libs/hammerjs/2.0.8/hammer.min.js"></script> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> 

Warnings

 1. WARNING in ./~/@angular/material/module.js 64:4 export 'ProjectionModule' was not foun d in './core/index' 2. WARNING in ./~/@angular/material/module.js 89:16 export 'ProjectionModule' was not fou nd in './core/index' 3. WARNING in ./~/@angular/material/dialog/ind ex.js 21:75 export 'Platform' was not found in '. ./core' 

Error starting http: // localhost: 4200 /

 Uncaught TypeError: Cannot read property 'prototype' of undefined at __extends (snack-bar-container.js:4) at snack-bar-container.js:28 at Object.<anonymous> (snack-bar-container.js:122) at __webpack_require__ (bootstrap 9ff6af8…:52) at Object.<anonymous> (snack-bar-ref.js:70) at __webpack_require__ (bootstrap 9ff6af8…:52) at Object.<anonymous> (menu.js:40) at __webpack_require__ (bootstrap 9ff6af8…:52) at Object.<anonymous> (icon.js:264) at __webpack_require__ (bootstrap 9ff6af8…:52) 
+5
source share
1 answer

From the official documentation, you should import each module. I import everything at once during the development process, but without .forRoot () and it works fine:

  imports: [ MaterialModule, ], 
0
source

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


All Articles