使用 Angular Material 2.0.0-alpha.8-1 升级我的 Angular 2.0.0-rc.6 应用程序,我现在得到如下编译错误:
Property 'forRoot' does not exist on type 'typeof MdCoreModule'.
这是AppModule
:
import { MdCoreModule } from '@angular2-material/core/core';
import { MdButtonModule } from '@angular2-material/button/button';
import { MdButtonToggleModule } from '@angular2-material/button-toggle/button-toggle';
import { MdCardModule } from '@angular2-material/card/card';
import { MdCheckboxModule } from '@angular2-material/checkbox/checkbox';
// ... additional imports
@NgModule({
declarations: [
AppComponent,
// ... additional application-specific declarations
],
imports: [
BrowserModule,
CommonModule,
ReactiveFormsModule,
HttpModule,
JsonpModule,
MdCoreModule.forRoot(),
MdButtonModule.forRoot(),
MdButtonToggleModule.forRoot(),
MdCardModule.forRoot(),
MdCheckboxModule.forRoot(),
// ... additional imports
],
providers : [
Configuration,
// ... additional application-specific providers
],
entryComponents: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {
}
这是CHANGELOG中推荐的。任何想法我做错了什么?
"dependencies": {
"@angular/common": "2.0.0-rc.6",
"@angular/compiler": "2.0.0-rc.6",
"@angular/core": "2.0.0-rc.6",
"@angular/forms": "2.0.0-rc.6",
"@angular/http": "2.0.0-rc.6",
"@angular/platform-browser": "2.0.0-rc.6",
"@angular/platform-browser-dynamic": "2.0.0-rc.6",
"@angular/router": "3.0.0-rc.2",
"@angular2-material/button": "2.0.0-alpha.8-1",
"@angular2-material/button-toggle": "2.0.0-alpha.8-1",
"@angular2-material/card": "2.0.0-alpha.8-1",
"@angular2-material/checkbox": "2.0.0-alpha.8-1",
"@angular2-material/core": "2.0.0-alpha.8-1",
"@angular2-material/grid-list": "2.0.0-alpha.8-1",
"@angular2-material/icon": "2.0.0-alpha.8-1",
"@angular2-material/input": "2.0.0-alpha.8-1",
"@angular2-material/list": "2.0.0-alpha.8-1",
"@angular2-material/menu": "2.0.0-alpha.8-1",
"@angular2-material/progress-bar": "2.0.0-alpha.8-1",
"@angular2-material/progress-circle": "2.0.0-alpha.8-1",
"@angular2-material/radio": "2.0.0-alpha.8-1",
"@angular2-material/sidenav": "2.0.0-alpha.8-1",
"@angular2-material/slide-toggle": "2.0.0-alpha.8-1",
"@angular2-material/slider": "2.0.0-alpha.8-1",
"@angular2-material/tabs": "2.0.0-alpha.8-1",
"@angular2-material/toolbar": "2.0.0-alpha.8-1",
"@angular2-material/tooltip": "2.0.0-alpha.8-1",
"core-js": "^2.4.0",
"reflect-metadata": "0.1.8",
"rxjs": "5.0.0-beta.11",
"ts-helpers": "^1.1.1",
"zone.js": "0.6.17"
}
和
"devDependencies": {
"@types/hammerjs": "2.0.32",
"@types/jasmine": "^2.2.30",
"angular-cli": "1.0.0-beta.11-webpack.8",
"codelyzer": "0.0.26",
"hammerjs": "2.0.8",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "0.13.22",
"karma-chrome-launcher": "0.2.3",
"karma-jasmine": "0.3.8",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.3",
"reflect-metadata": "0.1.8",
"string-replace-loader": "1.0.3",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "2.0.0"
}
环境:
angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: linux x64