环境:Angular 2 RC5,ng2-bootstrap .. 从 RC4 升级到 RC5
错误:
Uncaught EXCEPTION: Error in http://localhost:4200/app/forgot-username/forgot-username.component.html:39:60
ORIGINAL EXCEPTION: Type ModalBackdropComponent is part of the declarations of 2 modules: Myodule and AppModule!
ORIGINAL STACKTRACE:
Error: Type ModalBackdropComponent is part of the declarations of 2 modules: MyModule and AppModule!
at new BaseException (http://localhost:4200/vendor/@angular/compiler/src/facade/exceptions.js:27:23)
这是我的模块
@NgModule({
imports: [ DynamicFormModule, routes ],
declarations: [ MODAL_DIRECTIVES, ForgotUsernameComponent ],
exports: [ ],
providers: [BS_VIEW_PROVIDERS, ]
})
应用模块
@NgModule({
imports: [
BrowserModule,
// FormsModule,
routing,
HttpModule,
ForgotUsernameModule
],
declarations: [
// AppComponent
],
bootstrap: [ AppComponent]
})
export class AppModule {
}
如您所见,我没有在 AppModule 中声明任何与 ng2-bootstrap 相关的工件(ModalBackdropComponent或任何其他)。所以我试图弄清楚为什么 Angular 2 认为我已经声明了它们。我怎样才能解决这个问题?