Reputation: 407
i'm trying to use ionic auto complete with my ionic 3 app , how ever , it shows this error message
'ion-auto-complete' is not a known element:
If 'ion-auto-complete' is an Angular component, then verify that it is part of this module.
If 'ion-auto-complete' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
[ERROR ->]
what i did is :
npm install ionic2-auto-complete --save
then added
{ AutoCompleteModule } from 'ionic2-auto-complete';
to my app.module.ts
then added
<ion-auto-complete></ion-auto-complete>
to HTML
Upvotes: 1
Views: 1610
Reputation: 433
In addition to add the import in the app.module.ts, you have to declare the AutoCompleteModule in the import section:
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes),
PipesModule,
ComponentsModule,
AutoCompleteModule
],
declarations: [MiPerfilPage]
})
If it doesn't work, try to do the same thing but in the PageModule.ts you want to use it. You can read this post too: https://github.com/kadoshms/ionic2-autocomplete/issues/109
Upvotes: 1