Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
部分视图上使用MVC的日期范围选择器AngularJS的问题_Angularjs_Asp.net Mvc_Partial Views - Fatal编程技术网

部分视图上使用MVC的日期范围选择器AngularJS的问题

部分视图上使用MVC的日期范围选择器AngularJS的问题,angularjs,asp.net-mvc,partial-views,Angularjs,Asp.net Mvc,Partial Views,部分视图上使用MVC的日期范围选择器AngularJS的问题 当我们尝试加载我的应用程序时,我的文本框显示为daterange选择器的[object object]。为什么不在文本框中显示daterange $scope.date = { startDate: moment().subtract(1, "days"), endDate: moment() }; $scope.SimplePickerChange = function(){ alert('hi');

部分视图上使用MVC的日期范围选择器AngularJS的问题

当我们尝试加载我的应用程序时,我的文本框显示为daterange选择器的[object object]。为什么不在文本框中显示daterange

 $scope.date = {
    startDate: moment().subtract(1, "days"),
    endDate: moment()
};

$scope.SimplePickerChange = function(){
  alert('hi');
    $scope.date = {        
      endDate:$scope.date.startDate.add(30,"days")
    }
    alert(JSON.stringify($scope.date));
};

$scope.singleDate = moment().add(30, "days");

$scope.opts = {
    locale: {
        applyClass: 'btn-green',
        applyLabel: "Apply",
        fromLabel: "From",
        format: "YYYY-MM-DD",
        toLabel: "To",
        cancelLabel: 'Cancel',
        customRangeLabel: 'Custom range'
    },
    ranges: {
        'Last 7 Days': [moment().subtract(6, 'days'), moment()],
        'Last 30 Days': [moment().subtract(29, 'days'), moment()]
    }
};

$scope.setStartDate = function () {
    $scope.date.startDate = moment().subtract(4, "days").toDate();
};

$scope.setRange = function () {
    $scope.date = {
        startDate: moment().subtract(5, "days"),
        endDate: moment()
    };
};

//Watch for date changes
$scope.$watch('date', function(newDate) {
    console.log('New date set: ', newDate);
}, false);

它是[object object],因为它试图将
.toString()
强制转换为它。你能先显示你的代码吗?