md-autocomplete + md-min-length="0" + required fails (throws exception)
Open the md-autocomplete demo in Code Pen and add the required property to it.
Now select one state and start backspacing the content. When you delete the final letter you will get an exception: "Cannot read property 'toLowerCase' of undefined".
This is happening at line 17857 in the handleQuery function:
function handleQuery () {
var searchText = $scope.searchText,
term = searchText.toLowerCase();
}
Somehow, the $scope.searchText is undefined instead of being an empty string. The weird thing is that this only happens when the md-autocomplete is required.
Of course you will only see it if md-min-length is 0.
+1
+1
+1
http://codepen.io/anon/pen/rOJgGK
input empty
+1