0

I am trying to create a template with a paginated table and am using the example from https://material.angular.io/components/table/overview#pagination which has a link to a stackblitz example https://stackblitz.com/angular/bymxnvovkvk

When I download the code, run npm install and then ng serve I see a page that looks simialar, but is missing some Material design and looks very flat. When I try to add other material items like a Sidenav, I get errors stating "can not find module “@angular/material”. I verified that it is included, but why would it not work on my machine if its working on stackblitz?

RyanOC
  • 587
  • 5
  • 16

1 Answers1

1

I also had a problem with Angular material not working properly. I installed it through npm, but it seems that the better solution is to use,

ng add @angular/material.

This should work fine and make angular material work properly. You also might want to uninstall @angular/material first, using:

npm uninstall @angular/material

Hope it helps!

PS Say no to the HammerJS option when it is installing.

Suggested reading: https://material.angular.io/guide/getting-started

Compiler v2
  • 3,509
  • 10
  • 31
  • 55
  • Your answer did help. I did that and was able to get it to style correctly after adding the theme to the angular.json file as menitoned here https://stackoverflow.com/a/56016261/1486716 – RyanOC Jul 11 '19 at 17:57