Saurabh Verma Saurabh Verma - 3 months ago 30x
AngularJS Question

AngularMaterial md-chips : Dont show selected item in <md-autocomplete>

I'm trying the

example from here md-chips

To prevent the selected items from coming inside
I've modified the querySearch function like this:

function querySearch (query) {
var results = query ? self.searchData.filter(createFilterFor(query)) : [];
var finalResults = [];
angular.forEach(results, function(result) {
if($scope.selectedItems.indexOf( < 0) {
return finalResults;

But my problem is that the control does not come inside this function once we select an item. Can someone please explain how to solve this ?


I found the solution from this documentation: md-autocomplete

We just need to add md-no-cache="true" for calling the querySearchfunction each time we search for a query item