错误:未捕获(承诺):错误:未为SelectSearchablePageComponent找到组件工厂

时间:2018-09-13 10:28:01

标签: angular ionic3

我正在离子3上使用此pluign,所以我处于延迟加载状态。我将模块导入了页面

.module.ts:

import { NgModule} from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { NPage } from './nuovo-precario-fuori-graduatoria';
import { SelectSearchableModule } from 'ionic-select-searchable';
@NgModule({

  declarations: [
    NPage
  ],
  imports: [
    IonicPageModule.forChild(NPage),
    SelectSearchableModule
  ],
})
export class NPageModule {}

然后在这里html:

 <ion-item >
    <ion-label>Co</ion-label>
    <select-searchable item-content 
      #selection 
      *ngIf="pa && pa.length>0" 
      margin-right 
      [(ngModel)] = "user"
      itemValueField="code"
      itemTextField="description"
      [items]="pa"
      [canSearch]="true"
      (onChange)="countryChange($event)">
    </select-searchable>
  </ion-item>

我用一些对象填充了数组,但是当我单击dropdwon select图标时,出现此错误:

  

错误错误:未捕获(承诺):错误:找不到组件工厂   用于SelectSearchablePageComponent。您是否将其添加到   @ NgModule.entryComponents?错误:找不到用于的组件工厂   SelectSearchablePageComponent。您是否将其添加到   @ NgModule.entryComponents?

1 个答案:

答案 0 :(得分:1)

尝试这样的事情:

@NgModule({

  declarations: [
    NPage
  ],
  imports: [
    IonicPageModule.forChild(NPage),
    SelectSearchableModule
  ],
  entryComponents: [
    SelectSearchablePageComponent
  ]
})
export class NPageModule {}