Angular2 - MaterializeCSS: Modal dialogs don't open

I found a solution. Was quite frustrating to get there but here it is:

I reinstalled everything that was related to materialize + angular-cli, being angular2-materialize, materialize-css, jquery and hammerjs (which does not need to be installed manually).

Then I followed the instruction from npmjs and removed the part which imports material-css in app.module.ts.

import "materialize-css";

And after that everything works just fine. No need to alter the webpack settings in angular2-materialize package or anything like that. My versions are:

  • angular-cli 1.0.0-beta.16
  • angular2-materialize 5.2.1
  • materialize-css 0.97.7
  • jquery 2.2.4

I hope that I can save other people some frustrating hours I had with that.