oferh / ng2-completer

Angular 2 autocomplete component
http://oferh.github.io/ng2-completer/
MIT License
347 stars 172 forks source link

disableInput change whit promise using async remote service do not work #263

Open gaalvarez opened 7 years ago

gaalvarez commented 7 years ago

I have the next template and component.

<ng2-completer disableInput="!enable" formControlName="control" [inputClass]="'form-control'" [(ngModel)]="input" [datasource]="source" [maxChars]="12" [minSearchLength]="2" (blur)="onBlur()"

var promise_source = this.crudService.get(Constants.URL_API).then((data2: any) => { this.enable = true; return Promise.resolve(data2); }); this..source = this.completerService.local(Observable.fromPromise(promise_source), "name", "des"); The initial value of enable is false, but is changed whit the response api and in the view the completer still disabled.

oferh commented 7 years ago

can you try: [disableInput]="!enable"