One potential method is to attach the icon to the md-input-container within the md-autocomplete. This container is only added if the md-floating-label attribute is utilized.
In JavaScript: Using a timeout and compilation was necessary for the icon to display. By adding the md-icon-left class, the input gains a padding of 36px, similar to other md-input-containers with icons.
The attrs[vm.name] will utilize the attribute value as the icon name.
...
.directive('appendIcon', appendIcon);
function appendIcon($timeout, $compile) {
return {
restrict: 'A',
link: function(scope, elem, attrs) {
var vm = this;
$timeout(function() {
var container = angular.element(elem[0].querySelector('md-input-container'));
container.addClass('md-icon-left');
var icon = $compile('<md-icon class="material-icons">' + attrs[vm.name] + '</md-icon>')(scope);
container.append(icon);
});
}
};
};
In HTML: Take note of append-icon="search" and md-floating-label="State."
<md-autocomplete
append-icon="search"
md-floating-label="State"
id="custom" flex=""
required=""
Check out the codepen here:
http://codepen.io/eydrian/pen/ZLdgwQ