我有md-autocomplete
指令并尝试搜索并在选择项目时单击按钮清除(交叉)。我做错了什么?
var buttons = document.querySelector('md-autocomplete button');
buttons.onclick();
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<md-autocomplete class="city"
ng-disabled="isDisabled"
md-no-cache="false"
md-selected-item="selectedItem"
md-search-text-change="searchTextChange(searchText)" md-search-text="searchText"
md-selected-item-change="selectedItemChange(item)" md-items="item in querySearch(searchText)"
md-item-text="item.display" md-min-length="1" placeholder="{{point.place}}">
<md-item-template>
<span md-highlight-text="searchText" md-highlight-flags="^i">{{item.display}}</span>
</md-item-template>
<md-not-found>
No matches found.
</md-not-found>
</md-autocomplete>