Ali Mhanna
Ali Mhanna

Reputation: 407

'ion-auto-complete' is not a known element:

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:

  1. If 'ion-auto-complete' is an Angular component, then verify that it is part of this module.

  2. 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

Answers (1)

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

Related Questions