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

前端 未结 7 1939
青春惊慌失措
青春惊慌失措 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 15:07

    Rather than using a different function you can use a different is-open attribute and then pass the attribute in through the ng-click function. You still need different models:

    And inside controller:

       $scope.open = function($event,opened) {
        $event.preventDefault();
        $event.stopPropagation();
    
        $scope[opened] = true;
      };
    

提交回复
热议问题