Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ui-select ng-model="noPostData.locaopt.id" theme="select2" on-select="validDropDown()">
- <ui-select-match placeholder="Select location">{{$select.selected.name}}
- </ui-select-match>
- <ui-select-choices refresh="locationSearchData($select.search)" refresh-delay="0" minimum-input-length="2"
- repeat="obj.id as obj in locaoptions">
- <div ng-bind-html="obj.name"></div>
- </ui-select-choices>
- </ui-select>
- $scope.locationSearchData=function(char) {
- singleservice.getTableDetails("/location/list?fields=id,name&filter[name]="+char+"%&per-page=100","GET")
- .then(function (response){
- $scope.locaoptions=response;
- console.log(response);
- });
- }//this is called when refresh is called from ui-select on search input text change
- singleservice.getTableDetails($scope,"/location/list?fields=id,name","GET")
- .then(function (response){
- $scope.locaoptions=response;
- }); //this is just called for initial data loading in dropdown
Add Comment
Please, Sign In to add comment