How to have at least two datepickers of ui-bootstrap on a single page?

前端 未结 7 1948
青春惊慌失措
青春惊慌失措 2020-12-04 14:12

I want to have several datepickers on a page. But with the default solution from UI-Bootstrap it is not possible, no one of datepickers may be opened. The conflict with each

7条回答
  •  生来不讨喜
    2020-12-04 14:54

    Can open multi datepickers of ui-bootstrap on a single page

    JS

      $scope.open = {};
      $scope.openCalendar = function (e, date) {
        e.preventDefault();
        e.stopPropagation();
    
        if ($scope.open[date] === true) {
          $scope.open = {};
        } else {
          $scope.open = {};
          $scope.open[date] = true;
        }
      };
    

    HTML

    
    
    
    

提交回复
热议问题