Select with search

Hello varshil29,

I didn’t get around to working on Ionic 2 yet, but I believe should create it as a Component.
See this link below
Component

Could you post your solution please? Because i face the same problem. I can’t keep the selected value if i change the view.

Thanks in advance!

http://jsfiddle.net/rLn6v8s0/

@stamceidas Here the fix for the lost value when click dropdown button issue. I save the value when clear ngModel (the input text to search). You have to clear the ngModel to show all the dropdownlist-search-items. And then if you don’t typing but click dropdown again, surely the dropdownlist disappear and you get the ngModel back (which nice and neat).

  scope.open = function() { 
    if (scope.ngModel === undefined) {
      scope.ngModel=scope.ngTemp;
    }
    else  {
     scope.ngTemp = scope.ngModel;
      scope.ngModel = undefined;
    } 
    $timeout(function() {
      return scope.showHide = !scope.showHide;
    }, 100);
  };

Thanks for sharing Cristofer

hi cristofer, thank u for your great select,
please add close event like ion-select close, to close select modal programmatically.
thanks.

Hi Cristofer, How do I set ngValue there. It’s not working.