Datepicker not opening twice in angular-ui version 0.11.0

前端 未结 11 1644
一向
一向 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:16

    After looking at so many answers. What worked for me is something like below:

    $scope.datePicker = {
      date_opened:false
    }
    $scope.open_from = function($event) {
      $event.preventDefault();
      $event.stopPropagation();
      $scope.datePicker.date_opened = true;
    };
    

    HTML Template:

    We do not have to involve $timeout fixing this issue. I mean why if someone does not need it. I fixed this issue by changing my attribue is-open="date_opened" to is-open="datePicker.date_opened". Always a best practice initializing key to you object.

提交回复
热议问题