Angular 2 & Ng2Material

Following the steps in the tutorial i tried to add the Ng2Matierials to my project.

Then added the MATERIAL_DIRECTIVES and MATERIAL_PROVIDERS as shown.

Project immediately fails… asks for the components … none added yet.

Cannot find module ‘@angular2-material/checkbox’

I tried to add Ng2Materials to a project yesterday and experienced the same, even though I wasn’t planning on, or trying to, use a checkbox.

I had not used anything … just the directive and provider.
I’ll work it more soon.

Developed a workaround after much Googling.

  1. npm install ng2-material --save
  2. npm remove @angular2-material
    #1 installs, @angular2-material/core@2.0.0-alpha.6", which has bugs
  3. npm install @angular2-material/core@2.0.0-alpha.5-2 --save
    – replaces the removed one
  4. npm install --save @angular2-material/checkbox
    – defaults ng2-material needs this, you get errors and it does not install
  5. Installed all the downgraded components first. All need to be installed, then the overlay error disappears:
    npm install --save @angular2-material/core@2.0.0-alpha.5-2
    npm install --save @angular2-material/progress-bar@2.0.0-alpha.5-2
    npm install --save @angular2-material/progress-circle@2.0.0-alpha.5-2
    npm install --save @angular2-material/radio@.0.0-alpha.5-2
    npm install --save @angular2-material/sidenav@2.0.0-alpha.5-2
    npm install --save @angular2-material/toolbar@2.0.0-alpha.5-2

By the way, we updated the tutorial to use angular2-material instead of ng2-material.
If you have issues with the new version of the tutorial, please submit an issue