Angularjs ui-jq daterangepicker 值

Angularjs ui-jq daterangepicker value(s)

我有以下输入:

    <input ui-jq="daterangepicker" ui-options="{
    format: 'YYYY-MM-DD',
    startDate: '2013-01-01',
    endDate: '2013-12-31'
  }" ng-model="dateRange" class="form-control w-md" />

使用以下控制器:

    app.controller('AnalyticDashboardController', ['$http', '$scope','$sessionStorage','$log','Session','api','activityService',  function ($http, $scope, $sessionStorage,$log, Session, api,activityService) {

    $scope.dateRange = 'None';

}]);

但是,当更改值时,dateRange 值不会更改。

所以我的问题是如何获取此日期范围的值?

像这样改变你的HTML

  <input ui-jq="daterangepicker" ui-options="dateRangeOptions" ng-model="dateRange" class="form-control w-md" />

并且日期范围必须有 "startDate" 和 "endDate"

app.controller('AnalyticDashboardController', ['$http', '$scope','$sessionStorage','$log','Session','api','activityService',  function ($http, $scope, $sessionStorage,$log, Session, api,activityService) {
    $scope.dateRangeOptions = {
            format: "YYYY-MM-DD",
            min: "2015-05-01"
        };
    $scope.dateRange = {
                startDate: '2015-05-01',
                endDate: '2015-05-30'
            };

}]);