Angular 2 & Ng2Material


#1

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’


#2

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.


#3

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


#4

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

#5

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