Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

autocomplete not working for input if data is dynamically bind through webservice #351

Open

Description

@prasadsawant12

I am implementing autocomplete for input text box.
my html is--->

    <mz-input-container class="input-field col s12">
      <i class="icon-vkv-icons-set-28 prefix"></i>
      <input mz-input mz-validation [formControl]='pinCodeCtrl' id="pinCode" type="text"
             [errorMessageResource]="errorMessageResources.pinCode" [autocomplete]="pincodes"
             [label]="'Enter your pincode'" />
    </mz-input-container>

Here if i bind pincode statically then auto complete works.

but if i try to fill pin code dynamically using web service then it dont work even if static and dynamic pincode collection are same .

My controller is -- >
ngOnInit() {
this.pincodeDataService.getPincodeList(pincodeInitials)
.subscribe((data) => {
this.pincodes1 = data;
this.pincodes1.forEach(s => {
if (this.pincodes["data"] == undefined)
this.pincodes["data"] = {};
this.pincodes["data"][s.pin_code] = s.pin_code_id;
})
}

is there any demo or way which will show dynamic autocomplete.

Activity

  1. niknak88 commented on Feb 20, 2019

    @niknak88

    up
    I'm the same issue

  2. prasadsawant12 commented on Feb 20, 2019

    @prasadsawant12
    Author

    You have to manually fire the autocomplet method of ngx using view child

  3. niknak88 commented on Feb 20, 2019

    @niknak88

    @prasadsawant12 have you an example ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions