Search code examples
jhipster

How to add angular material design to jhipster


I am trying to add material desing to jhipster generated gateway. Although it seems it is working I am getting this warning on console;

Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming
Could not find HammerJS. Certain Angular Material components may not work correctly.

Below lines are added to package.json dependencies

"@angular/material": "^2.0.0-beta.7",
"hammerjs": "^2.0.8",

Below lines are added to global.scss

@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,400i,500,700');
@import '~@angular/material/prebuilt-themes/indigo-pink.css';

Just note that if I comment out indigo-pink.css line UI becomes uglier so I conclude that this css is imported successfully when not commented.

Jhipster version is 4.5.6

What can be the reason for the warning

Edit 1: this solves the hammerjs warning https://stackoverflow.com/a/41322757/795168 , but still theme warning and problem on UI is continues


Solution

  • Adding angular material to monolothic jhipster project worked for me by deleting hammerjs if it is installed

    npm uninstall hammerjs --save
    

    and verify that is deleted in package.json file