【问题标题】:Chrome (WebKit) ng-model issues with select display value选择显示值的 Chrome (WebKit) ng-model 问题
【发布时间】:2014-11-03 00:43:39
【问题描述】:

我认为我遇到了这个错误:

Github -> AngularJS -> #7986

这是我的代码:

<select ng-model="storeaccount" ng-init="storeaccount = store != 0 ? store : null" ng-options="storedata.id as storedata.name for storedata in stores" ng-change="storeAccountChange(storeaccount)">
    <option value="">-- Choose store account --</option>
</select>

有人知道我如何解决这个问题吗? 我尝试更改我们使用的所有库的版本,但没有任何结果。

【问题讨论】:

    标签: android angularjs google-chrome webkit


    【解决方案1】:

    问题是在触发模糊事件之前,Android 上的 Chrome 中显示的值没有改变。所以,我通过创建这个小指令解决了这个问题:

        link: function(scope, element, attrs) {
    
            scope.$on('blur', function(event, operation){
                if (operation == attrs.bluron) element[0].blur();
            });
    
        }
    

    【讨论】:

      猜你喜欢
      • 2018-11-13
      • 2020-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      • 2016-05-22
      相关资源
      最近更新 更多