2017-08-15 72 views
0

是否有人能夠獲得Angular4,Material和Animations(菜單必需)以使用Visual Studio代碼。Angular4,Materials and Angular4

開始通過從GitHub下載: 混帳克隆https://github.com/angular/quickstart.git

在VS代碼開放,編譯並運行,它的工作原理。

現在使用NPM

安裝材料2(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啓動**

的錯誤(他們中的一些)

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

我建議使用[Angular CLI](https://github.com/angular/angular-cli)來創建您的項目 - 快速入門項目不太好,我認爲他們停止在網站的最新更新中推薦它來支持CLI。除此之外,如果您尚未推薦閱讀Angular Material GitHub上的[Getting Started](https://github.com/angular/material2/blob/master/guides/getting-started.md)指南, 。 –

+0

編譯時會出現什麼錯誤?你如何導入材料和動畫? – ChrisG

+0

讓sire yoir也安裝材質cdk,按照這個教程,它應該工作:https://github.com/angular/material2/blob/master/guides/getting-started.md – Faisal

回答