Angular 4 with material

I am trying to implement "Angular -Material" using Angular4. I made all the settings from the official website of angular material [angular.material.io] [1]

[1]: https://material.angular.io/guide/getting-started , but when trying to start a project to start npm, I received the following error:

node_modules/@angular/material/typings/button/button.d.ts (40,22): error TS2420: Class' MdButton 'does not correctly implement the' CanDisable interface. The disabled property is private in the MdButton type, but not in the CanDisable type. node_modules/@angular/material/typings/button/button.d.ts (40.39): error TS2507: Type '(new (... args: any []) => CanDisable) and typeof MdButtonBase' is not a type constructor functions. node_modules/@angular/material/typings/checkbox/checkbox.d.ts (43,22): error TS2420: class' MdCheckbox 'does not correctly implement the' CanDisable interface. The disabled property is missing in the MdCheckbox type. node_modules/@angular/material/typings/checkbox/checkbox.d.ts (43,41): error TS2507: Type '(new (... args: any []) =>CanDisable) and typeof MdCheckboxBase 'is not a type of constructor function. node_modules/@angular/material/typings/radio/radio.d.ts (24,22): error TS2420: class "MdRadioGroup" does not correctly implement the 'CanDisable interface. The disabled property is missing in the MdRadioGroup type. node_modules/@angular/material/typings/radio/radio.d.ts (24,43): TS2507 error: Type '(new (... args: any []) => CanDisable) and typeof MdRadioGroupBase' is not a constructor type of function. node_modules/@angular/material/typings/slide-toggle/slide-toggle.d.ts (14,22): error TS2420: class' MdSlideToggle 'does not correctly implement the' CanDisable interface. The 'disabled' property is missing in the 'MdSlideToggle type. node_modules/@angular/material/typings/slide-toggle/slide-toggle.d.ts (14,44): error TS2507:Type '(new (... args: any []) => CanDisable) and typeof MdSlideToggleBase' is not a constructor function type. node_modules/@angular/material/typings/slider/slider.d.ts (26,22): error TS2420: class "MdSlider" does not correctly implement the 'CanDisable interface. The disabled property is missing in the MdSlider type. node_modules/@angular/material/typings/slider/slider.d.ts (26.39): error TS2507: Type '(new (... args: any []) => CanDisable) and typeof MdSliderBase' is not a type constructor functions.disabled "is absent in the type" MdSlider ". node_modules/@angular/material/typings/slider/slider.d.ts (26.39): error TS2507: Type '(new (... args: any []) => CanDisable) and typeof MdSliderBase 'is not a constructor function type.disabled "is absent in the type" MdSlider ". node_modules/@angular/material/typings/slider/slider.d.ts (26.39): error TS2507: Type '(new (... args: any []) => CanDisable) and typeof MdSliderBase 'is not a constructor function type.

-, , .

+4
2

package.json devDependencies typescript. , 2.2.0 .

"typescript": "~2.2.0"

,

$ npm update -D

package.json typescript,

$ npm install -g typescript@2.2.0
+3

, package.json:

package.json devDependies, : package.json

1: typescript 2.2.0, , .

2: npm -D

3: typescript, :

npm install -g typescript @version-number

0

Source: https://habr.com/ru/post/1677147/


All Articles