将我的Angular 2.0.0-rc.6应用程序与Angular Material 2.0.0-alpha.8-1升级后,我现在遇到了编译错误,例如:
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 {
}
这与更改日志中推荐的相同。你有什么想法,我错在哪里了吗?
"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
2.0.0-rc.5
的引用? - Madhu Ranjan