My md-autocomplete doesn't show data and the md-not-found data at the same time.
angular.module('BlankApp').controller('ctrl', function($scope, $q){
$scope.items = [{name: 'item1', id: 1}, {name: 'item2', id: 2}, {name: 'item3', id: 3}];
$scope.promisedItems = function(){
var deferred = $q.defer();
deferred.resolve(items);
return deferred.promise;
}
});
<md-autocomplete md-selected-item="selectedItem2" md-search-text="searchText2" md-items="item in promisedItems()" md-item-text="item.name" md-min-length="0" placeholder="items">
<md-item-template>
<span md-highlight-text="searchText2" md-highlight-flags="^i">{{item.name}}</span>
</md-item-template>
<md-not-found>
No states matching "{{searchText2}}" were found.
</md-not-found>
</md-autocomplete>
Attempt1 shows the data but doesn't show the 'not-found-message'.
Attempt2 does show the 'not-found-message' but won't show data.
I wrapped it inside a promise.
How can I get them both to work at the same time?