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

filter selected items. #2

Closed valentin-dirken closed 9 years ago

valentin-dirken commented 9 years ago

Change : scope.open = function () { scope.isOpen = true;

                scope.dropdownPosition();

            };

TO : scope.open = function () { scope.isOpen = true;

                scope.dropdownPosition();
                scope.filterSelected(); // by Valentin

            };

like this, you can do in the controller : contactsAPIservice.getEmployees() .success(function(response) {
$scope.EmployeesSelected = [3,10,12]; // or from a service request $scope.Employees = response; });

See you ;-)

indrimuska commented 9 years ago

Hi @valentin88, thank you for interesting in Angular Selector.

I'm not sure I'm understanding your problem, could you provide a Plunker, or at least give me a little context of where you're seeing it?

valentin-dirken commented 9 years ago

I'm at work, I'm going to answer you tonight ;-) (I will edit this post)

indrimuska commented 9 years ago

Hi @valentin88, Maybe you want to update your options dynamically from a remote request.

If so, you could check out these three plunkers or just take a look at the demo site:

Let me know if I'm wrong, or some of these examples could help you.