I am in need of assistance with updating the search list of my second <md-autocomplete>
drop-down based on the selection made in the first drop-down.
You can take a look at an example plunker which is not currently functioning properly: http://plnkr.co/edit/GxQujjAcxYdawlANJd9O?p=preview
Desired behavior:
When a user selects, for instance, "This is an A" from the first drop-down, I want to update the options to $scope.numbersA
, which would be [1, 2, 3]. Similarly, if someone chooses "This is a B", then the corresponding number array would be $scope.numbersB
, and so on.
I have been struggling to make this functionality work as intended. In my application, there is an $http request triggered for every change in the first drop-down. As mentioned on this Stack Overflow post, I am using .then() instead of .success(). The plunker example has been simplified due to less code complexity :)
Edit: Please note that there is an issue with the searchText function in the plunker, but it functions correctly in my actual application.