//Date control
$scope.opts = { locale: { format: 'YYYY/MM/DD', separator: ' - ', applyLabel: '确定', cancelLabel: '取消', weekLabel: 'W', customRangeLabel: 'Custom Range', daysOfWeek: moment.weekdaysMin(), min: '', max: '', monthNames: moment.monthsShort(), firstDay: moment.localeData().firstDayOfWeek() }, eventHandlers: { 'apply.daterangepicker': function (ev) { if ($scope.submitTime.startDate != "") { $scope.query.BeginSubmitTime = sourceService.convertData($scope.submitTime.startDate._d); $scope.query.EndSubmitTime = sourceService.convertDataEnd($scope.submitTime.endDate._d); } if ($scope.modifyTime.startDate != "") { $scope.query.BeginCreatetime = sourceService.convertData($scope.modifyTime.startDate._d); $scope.query.EndCreatetime = sourceService.convertDataEnd($scope.modifyTime.endDate._d); } $scope.getProjectAuditPageList(); } } }
This is js code, the code is in the same js; after determining the time box, you can enter this method, but the time box in ng-include cannot get the value after clicking. I would like to ask for a solution ?
You can define an object such as obj outside, and then bind an ng-model="obj.submitTime" to the ng-model. The reason may be that the Scope of the unavailable ng-model is actually an outer layer. The obtained subScope.