我有一个自定义组件(MyComboBox)里面有kendo-combobox.
当我使用我的核心模块时,webpack编译成功结束,但chrome抛出以下错误:
Uncaught Error: Unexpected directive 'MyComboBox' imported by the module 'AppModule'. Please add a @NgModule annotation.
Run Code Online (Sandbox Code Playgroud)
这是我的AppModule:
app.module.ts
import { MyComboBox } from '@my/core/control/MyComboBox';
@NgModule({
declarations: [
AppComponent,
MyComboBox
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
DragulaModule,
MyComboBox,
CoreModule,
ComboBoxModule
],
entryComponents: [ MyComboBox ],
providers: [HelperService],
bootstrap: [AppComponent]
})
Run Code Online (Sandbox Code Playgroud)