javascript - angularJs cannot get the ng-model value of date-range-picker
伊谢尔伦
伊谢尔伦 2017-06-26 10:57:36
0
1
723

//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 ?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all (1)
刘奇

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.

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!