Datepicker not opening twice in angular-ui version 0.11.0

前端 未结 11 1715
一向
一向 2020-12-28 12:43

I am trying to have 2 datepickers and I am using Angular UI version 0.11.0.

My HTML code


     

        
11条回答
  •  自闭症患者
    2020-12-28 13:15

    Just isolate your dataPicker state variables.

    $scope.dataPickerStates = {
      open1:false,
      open2:false
    }
    

    then change your html to

    
    

    and finally your state changer method

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

    that's it.

提交回复
热议问题