Datepicker not opening twice in angular-ui version 0.11.0

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

    I have the easiest, one-line solution that does not require container objects, function calls or other hassles like preventDefault. You don't even have to declare this in scope because undefined is evaluated as false.

    ...
      ng-click="dateOpened = !dateOpened"
    ...
    

    I tested this with angular-ui 0.13.0 (Angular Bootstrap). This works because the invocation of ng-click is already trapping the default event.

提交回复
热议问题