2015-10-28 27 views
6

我想在md-autocomplete上使用模糊事件,但ng-blur和md-blur都不起作用。如何在md-autocomplete上使用ng-blur?

$scope.unFocus = function() { 
 
      alert('Hello!'); 
 
     }
<md-autocomplete md-no-cache="false" md-selected-item="selectedItem" md-search-text-change="searchLocation(searchText)" 
 
        md-search-text="searchText" md-items="item in searchResult" md-item-text="item.address" 
 
        md-selected-item-change="changeLocation(item)" md-min-length="0" md-floating-label="Your Address" ng-blur="unFocus()"> 
 
      <md-item-template> 
 
       <span md-highlight-text="searchText" md-highlight-flags="^i">{{item.address}}</span> 
 
      </md-item-template> 
 
      <md-not-found> 
 
       <i>Not Found {{searchText}}</i> 
 
      </md-not-found> 
 
</md-autocomplete>

+0

的工作那你試試? – Lucio

+0

請提供一些代碼,它將有助於更好地理解您的prgm ...中出錯的人.. – SakthiSureshAnand

+0

UserLocation == null? – m59

回答

3

ngBlurngFocus將開始1.1.1版本角材料