cannot write an angular ui typeahed handler with typescript -
cannot write an angular ui typeahed handler with typescript -
i'm writing angular controller using typescript, , i'm using angular ui typeahead receive error during phone call update handler. angular directive
<input type="text" ng-model="vm.censimento.quartiere" placeholder="prima selezionare il comune" typeahead="address address in vm.updatequartieri($viewvalue)" typeahead-loading="loadinglocations" class="form-control" /> <i ng-show="loadinglocations" class="glyphicon glyphicon-refresh"></i>
this typescript routine
public updatequartieri = (typed: string) => { var filtro: factories.filtroricercaquartieri = new factories.filtroricercaquartieri(); filtro.testo = typed; filtro.idcomune = this.censimento.comuneid; var ultimipromise = this.censimentofactory.quartiericomune(filtro); ultimipromise.then((data: string[]) => { this.quartieri = data; }, (reason) => { alert('errore in recupero lista tipi via: ' + reason); }, (update) => { alert('got notification: ' + update); }); }
i suppose problem routine never homecoming value, how can alter routine homecoming result of server phone call ?
found solution, have homecoming promise object changing in
public updatequartieri = (typed: string) => { var filtro: factories.filtroricercaquartieri = new factories.filtroricercaquartieri(); filtro.testo = typed; filtro.idcomune = this.censimento.comuneid; var ultimipromise = this.censimentofactory.quartiericomune(filtro); homecoming ultimipromise; }
typescript angular-ui
Comments
Post a Comment