我想点击使用Angular UI Bootstrap库组件的按钮时弹出日期选择器。 在Angular UI Boostrap网站上都有这两个示例,但我没有看到将它们组合的方法。我不喜欢将日期选择器div
作为popup
指令文本的属性值的想法。Angular UI Bootstrap - Popup Datepicker
我也试图在日期选择器div
使用ng-show
但我不能说对任何工作。
这是我现在的代码。
<div ng-controller="DatepickerCtrl" class="input-append">
<input class="input-small ng-pristine ng-valid"
type="text"
ng-value="dt" />
<button type="button"
class="btn"
popover-placement="right"
ng-click"showDatePicker=true" // the show when clicked strategy
popover="On the Right!"> // Don't see a way to make this encapsulate a div
<i class="icon-calendar"></i>
</button>
<datepicker ng-model="dt"
ng-show="showDatePicker"
starting-day="1"
date-disabled="disabled(date, mode)"
min="minDate" max="'2015-06-22'">
</datepicker>
</div>
我不太喜欢ng-show
策略。宁愿它是一个流行的东西,但我认为有办法做得更好,所以我也不介意。
尝试使用[Angular Strap](http://mgcrea.github.io/angular-strap/#/datepicker)。 – Stewie
我已经看过它,并最终会使用它,如果没有解决方案。 –