Angularjs 使用角度材质md自动完成时出错
我正在使用角度材质自动完成。单击“自动完成”文本框时出错Angularjs 使用角度材质md自动完成时出错,angularjs,angularjs-material,Angularjs,Angularjs Material,我正在使用角度材质自动完成。单击“自动完成”文本框时出错 TypeError: Cannot read property 'then' of undefined at me (angular-material.min.js:13) at ve (angular-material.min.js:13) at e.q [as focus] (angular-material.min.js:13) at fn (eval at compile (angular.js:15152), <anony
TypeError: Cannot read property 'then' of undefined
at me (angular-material.min.js:13)
at ve (angular-material.min.js:13)
at e.q [as focus] (angular-material.min.js:13)
at fn (eval at compile (angular.js:15152), <anonymous>:4:295)
at e (angular.js:26673)
at b.$eval (angular.js:17958)
at b.$apply (angular.js:18058)
at HTMLInputElement.<anonymous> (angular.js:26678)
at HTMLInputElement.dispatch (jquery.min.js:3)
at HTMLInputElement.r.handle (jquery.min.js:3)
这是我的html
<md-content layout-padding layout="column">
<form ng-submit="$event.preventDefault()">
<md-autocomplete ng-disabled="ctrl.isDisabled"
md-no-cache="ctrl.noCache"
md-selected-item="ctrl.selectedItem"
md-search-text-change="ctrl.searchTextChange(ctrl.searchText)"
md-search-text="ctrl.searchText"
md-selected-item-change="ctrl.selectedItemChange(item)"
md-items="item in ctrl.querySearch(ctrl.searchText)"
md-item-text="item.name"
md-min-length="0"
placeholder="Pick an Angular repository"
md-menu-class="autocomplete-custom-template">
<md-item-template>
<span class="item-title">
<md-icon md-svg-icon="img/icons/octicon-repo.svg"></md-icon>
<span> {{item.name}} </span>
</span>
<span class="item-metadata">
<span class="item-metastat">
<strong>{{item.watchers}}</strong> watchers
</span>
<span class="item-metastat">
<strong>{{item.forks}}</strong> forks
</span>
</span>
</md-item-template>
</md-autocomplete>
</form>
</md-content>
{{item.name}
{{item.watchers}}观察者
{{item.forks}forks
我无法跟踪此错误。请帮助。您没有实例化所选项目
self.selectedItem = [];
我已经写了var self=this;self.selectedItem=[];仍然不起作用。同样的错误。
self.selectedItem = [];