Datepicker not opening twice in angular-ui version 0.11.0

前端 未结 11 1677
一向
一向 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条回答
  •  梦毁少年i
    2020-12-28 12:53

    I had the same problem, but by simply putting the "opened" boolean var in an object solved the problem for me:

    < .. is-open="datePicker.opened" >
    ...
    $scope.datePicker = {opened:false};
    $scope.openDate = function($event) {
         $event.preventDefault();
         $event.stopPropagation();
         $scope.datePicker.opened = true;
    };
    

    I have not used angular for that long but I think this is scope problem and then I learned that it is always good to have "a dot in the variable name"... ( datePicker.opened )

    (I now see a post above with a similar solution. But I did not need to use the timeout. This code was enough.)

提交回复
热议问题