angular4でag-gridを使用しているときに、以下のエラーメッセージが表示されます。コンポーネントファクトリが見つかりません。 @ NgModule.entryComponentsに追加しましたか?
HTTP経由でjsonを取得した後に行データを表示しようとしています。
私のコードは以下のエラーメッセージです。
ERROR Error: No component factory found for RedComponentComponent. Did you add it to @NgModule.entryComponents?
これは私のアプリケーションモジュールのコードです。私はすでにentryComponentsに設定しています。
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AgGridModule} from "ag-grid-angular/main";
import { AppComponent } from './app.component';
import { MyGridApplicationComponent } from './my-grid-application/my-grid-application.component';
import { RedComponentComponent } from './red-component/red-component.component';
@NgModule({
imports: [
BrowserModule,
AgGridModule.withComponents(
[RedComponentComponent]
),
FormsModule,
HttpModule
],
declarations: [
AppComponent,
MyGridApplicationComponent,
RedComponentComponent
],
entryComponents: [
RedComponentComponent
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
私の質問。このコードがこのコンポーネントを解決できない理由
サーバを再起動してください。 – Ploppy
実行可能な複製を提供できますか? – yurzui
@Ploppyはサーバーを再起動しました。それでもなお発生します。 – sungyong