Guest User

Untitled

a guest
Jun 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <ui-select ng-model="noPostData.locaopt.id" theme="select2" on-select="validDropDown()">
  2. <ui-select-match placeholder="Select location">{{$select.selected.name}}
  3. </ui-select-match>
  4. <ui-select-choices refresh="locationSearchData($select.search)" refresh-delay="0" minimum-input-length="2"
  5. repeat="obj.id as obj in locaoptions">
  6. <div ng-bind-html="obj.name"></div>
  7.  
  8. </ui-select-choices>
  9. </ui-select>
  10.  
  11. $scope.locationSearchData=function(char) {
  12. singleservice.getTableDetails("/location/list?fields=id,name&filter[name]="+char+"%&per-page=100","GET")
  13. .then(function (response){
  14. $scope.locaoptions=response;
  15. console.log(response);
  16. });
  17. }//this is called when refresh is called from ui-select on search input text change
  18.  
  19. singleservice.getTableDetails($scope,"/location/list?fields=id,name","GET")
  20. .then(function (response){
  21. $scope.locaoptions=response;
  22. }); //this is just called for initial data loading in dropdown
Add Comment
Please, Sign In to add comment