angular-bootstrap-datetimepicker在日期选择上不自动关闭

时间:2016-10-20 09:57:39

标签: angularjs datetimepicker angular-bootstrap

我正在使用https://github.com/dalelotts/angular-bootstrap-datetimepicker datepicker。它不是自动关闭datepicker控件..

<div class="dropdown-toggle my-toggle-select" id="dLabel1" role="button" data-toggle="dropdown" >
<div class="input-append">
    <i class="fa fa-calendar input-icon input-icon-highlight"></i>
    <label id="lblCheckOut" ng-repeat="(key, value) in vm.homelabel | objectByKeyValFilter:'LblId':'lblCheckOut'">{{value.TextMessage}}</label>
    <input type="text" id="txtCheckOutDate" class="form-control" data-ng-model="CheckOutDate.date | date:'MMM d, EEE' " />
</div>
</div>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel1">
<datetimepicker data-ng-model="CheckOutDate.date" ng-click="$event.stopPropagation()" data-before-render="vm.beforeRender_CheckOutDate($view, $dates, $leftDate, $upDate, $rightDate,1);" data-datetimepicker-config="{ dropdownSelector: '.my-toggle-select' ,startView:'day', minView:'day'}"></datetimepicker>
</ul>

我找不到任何属性来自动关闭角度bootstrap datepicker ...

1 个答案:

答案 0 :(得分:2)

我通过将bootstrap类包装到给定的HTML来修复..

<div class="dropdown">
<div class="dropdown-toggle my-toggle-select" id="dLabel1" role="button" data-toggle="dropdown" >
<div class="input-append">
    <i class="fa fa-calendar input-icon input-icon-highlight"></i>
    <label id="lblCheckOut" ng-repeat="(key, value) in vm.homelabel | objectByKeyValFilter:'LblId':'lblCheckOut'">{{value.TextMessage}}</label>
    <input type="text" id="txtCheckOutDate" class="form-control" data-ng-model="CheckOutDate.date | date:'MMM d, EEE' " />
</div>
</div>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel1">
<datetimepicker data-ng-model="CheckOutDate.date" ng-click="$event.stopPropagation()" data-before-render="vm.beforeRender_CheckOutDate($view, $dates, $leftDate, $upDate, $rightDate,1);" data-datetimepicker-config="{ dropdownSelector: '.my-toggle-select' ,startView:'day', minView:'day'}"></datetimepicker>
</ul>
</div>

它正常工作..

感谢@Dale的审核和更新。