Reputation: 95
I have installed primeng on angular 5 project. I am using p-autoComplete component but this error occurs now. How should I do to fix this error?
This is my source code.
<h3 class="first">Basic</h3>
<p-autoComplete [(ngModel)]="country" [suggestions]="filteredCountriesSingle" (completeMethod)="filterCountrySingle($event)" field="name" [size]="30"
placeholder="Countries" [minLength]="1"></p-autoComplete>
Upvotes: 4
Views: 9651
Reputation: 6655
Usually it's a problem of import. Check your app.module.ts
file.
It should contain these lines :
import { AppComponent } from './app.component';
import {AutoCompleteModule} from 'primeng/autocomplete';
// other imports
@NgModule({
imports: [
AutoCompleteModule,
// ...
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Upvotes: 7
Reputation: 266
import { AppComponent } from './app.component';
import {AutoCompleteModule} from 'primeng/primeng';
// other imports
@NgModule({
imports: [
AutoCompleteModule,
// ...
],
exports: [
AutoCompleteModule
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Upvotes: 2