ng2-ui / auto-complete

Angular Auto Complete component and directive
https://ng2-ui.github.io/dist/#/auto-complete
MIT License
279 stars 123 forks source link

Binding saved data using FormBuilder to auto-complete whose source is direct URL gives error #273

Closed RawatPraveen closed 6 years ago

RawatPraveen commented 7 years ago

Although its working fine when no data is mapped to auto-complete and its loading it from server but when i have some data to bind it throws error

Here is my Input code:

<input type="text" formControlName="ContactOwner" class="form-control" placeholder="Owner" autocomplete="off" auto-complete [source]="_ownerURL" [list-formatter]="autocompleListFormatter" accept-user-input="false" value-property-name="id" display-property-name="value" (valueChanged)="onOwnerSelect($event)" />

Here is my FromBuilder:

this._fieldsForm = this.formBuilder.group({
  ContactId: [this._contactModal ? this._contactModal : 0]
  , ContactOwner: [this._contactModal ? this._contactModal.ContactOwner : '', Validators.maxLength(100)]});

I have checked my list-formatter is no creating any problem here its just when a values is assigned by FormBuilder to control it throws error as it is not mapped with id property.

Here is e auto-complete rror

allenhwkim commented 7 years ago

Is it related to #195?