Anton T
Anton T

Reputation: 95

Can't bind to 'suggestions' since it isn't a known property of 'p-autoComplete'

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

Answers (2)

Antikhippe
Antikhippe

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

sonal.paghdal
sonal.paghdal

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

Related Questions