How do you configure md-autocomplete
so that if you search for a word, it searches for strings within strings. At the moment it only finds the first word.
As with the demo https://material.angularjs.org/latest/demo/autocomplete, if you type new, it finds New Jersey. But if you type jersey, it does not find anything.
This is my querySearch
function
function querySearch(query) {
var results = query ? vm.subjects.filter(createFilterFor(query)) : vm.subjects,
deferred;
return results;
}
This is my createFilterFor
function
function createFilterFor(query) {
var lowercaseQuery = angular.lowercase(query);
return function filterFn(subject) {
return (subject.Display.indexOf(lowercaseQuery) === 0);
};
}