0

我正在使用角度 1 和角度 ui 完整日历。日历正在显示。如果我单击日历中的任何日期,我想将选定的日期值传递给控制器​​。但我无法将选定的日期值从 html 传递到控制器.

这是我的 html 日历

<div class="panel-body">
    <mwl-calendar
         events = "events"
         view = "calendarView"
         current-day = "calendarDay"
         ng-model = "selectedDate"
         view-title = "calendarTitle"
         ng-click = "dayClick(selectedDate)"
         delete-event-html = "'<div class=\'btn btn-danger btn-sm margin-right-10 pull-right\'><i class=\'ti-close\'></i></div>'"
         edit-event-click = "eventEdited($event)"
         delete-event-click = "eventDeleted($event)"
         on-drill-down-click = "false"
         cell-modifier = "modifyCell(calendarCell)">
    </mwl-calendar>
</div>

控制器

var SalesCalenderController = function($scope, $rootScope,$filter,
    $http, $location,$route,$routeParams,SalesCalenderService)
     {
         $scope.calendarView = 'month';
         $scope.calendarDay = new Date();
         $scope.dayClick = function(selectedDate) 
         {
             alert(selectedDate);
         };
         $scope.modifyCell = function(calendarCell) {
             for (var i = 0; i < $scope.dates.length; i++) {
                 if (moment(calendarCell.date).isSame(moment($scope.dates[i]), 'day'))
                     calendarCell.isCustom = true;
             };
         }
     }

但是在警报中我越来越不确定。谁能告诉如何在控制器中获取选定的日期值?

4

0 回答 0