Angular4,Materials和Angular4

时间:2017-08-15 15:32:11

标签: angular animation

是否有人能够使用Angular4,材质和动画(菜单所需)与Visual Studio Code一起使用。

首先从github下载: git clone https://github.com/angular/quickstart.git

在VS Code中打开,编译并运行,它可以工作。

现在使用NPM安装Material2(2.0.0-beta.8)

现在导入角度动画

和繁荣 - 没有任何编译和欢迎节点包地狱。

我还没有找到可以证明如何做到这一点的任何地方

帮助会很棒。

更多信息

安装:

npm install --save @angular/material @angular/cdk

npm install --save @angular/animations

和systemjs.config

  // other libraries
  'rxjs':                      'npm:rxjs',
  'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
  '@angular/material': 'npm:@angular/material/bundles/material.umd.js',
  '@angular/cdk': 'npm:@angular/cdk/bundles/cdk.umd.js',

  '@angular/animations': 'node_modules/@angular/animations/bundles/animations.umd.min.js',
  '@angular/animations/browser':'node_modules/@angular/animations/bundles/animations-browser.umd.js',
  '@angular/platform-browser/animations': 'node_modules/@angular/platform-browser/bundles/platform-browser-animations.umd.js'

** npm start **

错误(其中一些)

node_modules/@angular/material/typings/button-toggle/button-toggle.d.ts(32,22): error TS2420: Class 'MdButtonToggleGroup' incorrectly implements interface 'CanDisable'.
  Property 'disabled' is missing in type 'MdButtonToggleGroup'.
node_modules/@angular/material/typings/button-toggle/button-toggle.d.ts(32,50): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdButtonToggleGroupBase' is not a constructor function type.
node_modules/@angular/material/typings/button-toggle/button-toggle.d.ts(91,22): error TS2420: Class 'MdButtonToggleGroupMultiple' incorrectly implements interface 'CanDisable'.
  Property 'disabled' is missing in type 'MdButtonToggleGroupMultiple'.
node_modules/@angular/material/typings/button-toggle/button-toggle.d.ts(91,58): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdButtonToggleGroupBase' is not a constructor function type.
node_modules/@angular/material/typings/button/button.d.ts(55,22): error TS2420: Class 'MdButton' incorrectly implements interface 'CanColor'.
  Property 'color' is missing in type 'MdButton'.
node_modules/@angular/material/typings/button/button.d.ts(55,22): error TS2420: Class 'MdButton' incorrectly implements interface 'CanDisable'.
  Property 'disabled' is missing in type 'MdButton'.
node_modules/@angular/material/typings/button/button.d.ts(55,39): error TS2507: Type '(new (...args: any[]) => CanColor) & (new (...args: any[]) => CanDisable) & typeof MdButtonBase' is not a constructor function type.
node_modules/@angular/material/typings/checkbox/checkbox.d.ts(55,22): error TS2420: Class 'MdCheckbox' incorrectly implements interface 'CanColor'.

2 个答案:

答案 0 :(得分:0)

请尝试使用此链接http://csharp-video-tutorials.blogspot.sg/2017/05/setting-up-angular-2-in-visual-studio.html,以便明确了解如何在Visual Studio中使用angular。 虽然它是针对Angular2的。但是Angular4没有变化

答案 1 :(得分:0)

更新适合角度版本的材料版本。这将解决此问题。