I have a service the fetches keywords and I use ngFor to display these keywords as tags. But I am getting this above error
here is the code
<ion-content>
<ion-searchbar [(ngModel)]="myInput" [showCancelButton]="shouldShowCancel" (ionInput)="onInput($event)" (ionCancel)="onCancel($event)">
</ion-searchbar>
<ion-card *ngIf="suggest">
<ion-card-header>
Suggestions
</ion-card-header>
<ion-card-content>
<ion-badge *ngFor="let item of keyword;" > {{item.keyword}}</ion-badge>
</ion-card-content>
this is where i call the search service when
onInput(event) {
this.suggest = true;
this.keywords = this.logins.getkeywords(this.myInput).subscribe((data) => this.keywords = data)
}
and here is the service
getkeywords(item:string):any
{
return this.http.get('/mobile/term).map((res:Response)=>res.json())
}
here is the server response
[{"keyword":"asd"},{"keyword":"aptitude"},{"keyword":"arrangements"},{"keyword":"averages"},{"keyword":"aadasda"},{"keyword":"asdasd"},{"keyword":"anesthesiology"},{"keyword":"asds"}]