当前位置:Gxlcms > JavaScript > angular ng-model 无法获取值的处理方法

angular ng-model 无法获取值的处理方法

时间:2021-07-01 10:21:17 帮助过:57人阅读

该问题是由angular使用jq日期插件导致的无法双向绑定

<input id="dateDayStart" ng-model="dateDayStart" />

解决方法:重新绑定

setInterval(function () { 
    $scope.$apply(function () { 
      $scope.params.dateDayStart = document.getElementById('dateDayStart').value; 
    }); 
  }, 100); 

以上这篇angular ng-model 无法获取值的处理方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

人气教程排行