0
Starting with Angular 6. When trying to create a table, based on an example I picked up, I started having the following problem. I added in my module main, these lines:
import { MatInputModule, MatPaginatorModule, MatProgressSpinnerModule,
MatSortModule, MatTableModule } from '@angular/material';
and in the section Imports I also added, as below:
imports: [
BrowserModule,
FormsModule,
BrowserAnimationsModule,
HttpClientModule,
MatInputModule,
MatTableModule,
MatPaginatorModule,
MatSortModule,
MatProgressSpinnerModule
],
Well, it turns out on that line I have the following mistake:
from '@angular/material';
[ts] Cannot find module@angular/material'.
And also in the Imports, gives error in these two guys
BrowserAnimationsModule,
HttpClientModule,
So what I did. I went to package json. of the application and added this line:
"@angular/material": "^6.0.3",
well, anyway the error persists. Has anyone ever gone through this and managed to resolve? I’m searching but so far no conclusive answer.
well, I just found a link and I’m gonna test the guys' response and see what happens.
– pnet
You would actually do an npm install after inserting the line into package.json ?
– Lucas Brogni
@Lucasbrogni, yes I did it now. It didn’t solve, but I didn’t restart VS Code. I’ll do it now. I did it: npm install --save @angular/material
– pnet
did just npm install --save @angular/material @angular/cdk I’ll see if you’ve solved
– pnet
still persists, even restarting VS Code
– pnet