angularjs input标签用一个日期插件后数据不能双向绑定了

图片说明

图片说明
在模块中第一了$scope.operation = {nickName:'', operationModule:'', roleId:'',operationDetails:'',updatedDate:'',accessDate:''};
但是拿不到这个日期

求大神 很急.........

我之前用vueJS的时候也遇到类似的问题,可以在日期空间的change事件上手动赋值。

我们angularjs页面用的时间控件是这样的,没有问题
图片说明


下单时间

                    <div class="form-group">
                        <label>下单时间</label>
                        <input date-range-picker type="text" class="form-control date-picker" placeholder="下单时间" options="vm.dateRangeOptions" ng-model="vm.dateRangeModel" />
                    </div>

我这里用指令封装了一个 DATE

 *例子<input type="text" readonly  date-pick   ng-model="infor.dateValue"  id="dDateId"  ng-change="dateChange(infor.dateValue)"  />
*/ 
.directive( 'datePick', ['$compile','$rootScope', function( $compile,$rootScope ) {
    return {//想用双向的 请用对象
        restrict: 'A',
        require: 'ngModel',
        link: function ( scope, element, attrs,c ) {
            element.datepicker({
                  showOn: "both",
                  buttonImage: $rootScope.baseUrl+"images/calendar.png",
                  buttonText: "",
                  startDate:new Date(),
                  dateFormat : getDatePickerFormat($rootScope.userPreferences.dateFormatCode, $rootScope.userPreferences.dateFormat),//$rootScope.userPreferences.dateFormat.replace("MM","mm").replace("yyyy","yy"),
                  beforeShowDay: attrs.beforeShowDay == undefined ? $.datepicker.noWeekends : attrs.beforeShowDay,
                  showButtonPanel: true,
                  onSelect: function(selectedDate) {

                      if(attrs.beforeShowDay == undefined){
                          var tDate = jQuery(element).datepicker("getDate");
                          if(tDate.getDay()==6 || tDate.getDay()==0){
                              jQuery(element).val(c.$$lastCommittedViewValue);
                              $rootScope.openTips(project_translate.Page4_Label_Cannot_Select_Weekend);
                              return;
                          }
                      }
                      c.$setViewValue(selectedDate);//更新modal 值                   -  
                  }
            });
        }
    };
}])

我用的是jq ui 里面的时间插件

参考这个博客 https://blog.csdn.net/u014653197/article/details/55252832 我就是按照这个就解决了问题

解决方案是加一个onChange=""