【问题标题】:How to use ng-blur on md-autocomplete?如何在 md-autocomplete 上使用 ng-blur?
【发布时间】:2016-11-15 15:13:55
【问题描述】:

我想在 md-autocomplete 上使用 blur 事件,但 ng-blur 和 md-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>

【问题讨论】:

  • 请提供一些代码,这将有助于更好地理解您的 prgm 中出现的问题 ...man..
  • UserLocation == null 吗?
  • 这是 md-autocomplete 的问题。 github.com/angular/material/issues/3906

标签: angularjs angular-material md-autocomplete


【解决方案1】:

ngBlurngFocus 将从 1.1.1 版本的 Angular Material

开始工作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-09
    • 2016-05-03
    • 1970-01-01
    • 2017-08-11
    • 2016-09-22
    • 1970-01-01
    • 2016-04-20
    相关资源
    最近更新 更多