Closed shawcon closed 9 years ago
I have the same problem: When I want to populate the select with some data that comes from the server, it does not show up at all. Also, adding some items later to the array of items does not display those unless one types something into the search box.
Demo here (Complex objects: initialized from code (states) works, but when you click the "add some items" button, those items aren't being displayed then (only after searching for something)): http://plnkr.co/edit/BjcmUfdzca3VG1CV83gU?p=preview
This is because of the lazy evaluation of the filter function. It is a good idea to limit the filtering when the search is performed on the server, but for local scenarios it causes problems like this one. For that reason, I added an async
option to let the directive know that we're dealing with an async (remote) filter. If not set explicitly, the filtering is going to be performed every time the dropdown is open, pulling any new item that may have been after the last time it was open.
Fixed in commit 2e3c744c49fa0e84918fcc3bbe50245abee04d41.
the directive works perfectly when the page load complete. But when I have two cascade selectors,the first one selected,and the options of the second one changed,but the directive can not render the options again,keep the options loaded first time.
BTW,how to integrate the directive with bootstrap class form-control.