Reputation: 325
I'm using an autocomplete. When I click on the input, a dropdown opens with all possible fields to select.
My problem is that the fields do not appear visible, I have already tested using z-index etc and so far nothing has worked.
How can I solve this?
Code
<div class="form-group" style="padding-top: 10px;">
<div class="ng-autocomplete auto">
<ng-autocomplete [data]="countries" [searchKeyword]="keyword"
[itemTemplate]="itemTemplate" [notFoundTemplate]="notFoundTemplate">
</ng-autocomplete>
<ng-template #itemTemplate let-item>
<a [innerHTML]="item.departamento"></a>
</ng-template>
<ng-template #notFoundTemplate let-notFound>
<div [innerHTML]="notFound"></div>
</ng-template>
</div>
</div>
As you can see in the image, the information is there, but it does not appear visible :(
Upvotes: 2
Views: 438
Reputation: 22213
In #itemTemplate
, you need to bind name
since it is the property in your json
Try like this:
<ng-template #itemTemplate let-item>
<a [innerHTML]="item.name"></a>
</ng-template>
Upvotes: 3