我在离子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选择图标时,我有这个错误:
错误:未捕获(在承诺中):错误:找不到SelectSearchablePageComponent的组件工厂。你有没有把它添加到@ NgModule.entryComponents?错误:找不到SelectSearchablePageComponent的组件工厂。你有没有把它添加到@ NgModule.entryComponents?
试试这样的事情:
@NgModule({
declarations: [
NPage
],
imports: [
IonicPageModule.forChild(NPage),
SelectSearchableModule
],
entryComponents: [
SelectSearchablePageComponent
]
})
export class NPageModule {}