indrimuska / angular-selector

A native AngularJS directive that transform a simple <select> box into a full html select with typeahead.
http://indrimuska.github.io/angular-selector
MIT License
96 stars 36 forks source link

Remote search issues #69

Closed matt212 closed 7 years ago

matt212 commented 7 years ago

Hi, my issues is my search api url is /colum/words not search?colum=words . Could you please provide pointers wherein i can configure this plugin for /colum/words

indrimuska commented 7 years ago

Hi @matt212,

You can simply set a Promise object as remote property and build your own url.

<select selector remote="remote(search)" ... ></select>
$scope.remote = function (search) {
    return $http({ url: '/colum/' + search });
};

Note: $http service already returns a promise, so you don't need to wrap it yourself.

matt212 commented 7 years ago

Hi, i wanted to format the response from $http which involves promise when i use one i am getting this error promise issue