【发布时间】:2013-06-28 02:48:56
【问题描述】:
我希望在使用 Angular UI Bootstrap 库的组件单击按钮时弹出一个日期选择器。
Angular UI Boostrap 网站上有这两个例子,但我看不到将它们结合起来的方法。我不喜欢将 Datepicker div 作为 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 策略。宁愿它是一个弹出窗口,但我认为也有办法做得更好,所以我也不介意。
【问题讨论】:
-
我已经看过了,如果没有解决这个问题,最终会使用它。
标签: angularjs angular-ui-bootstrap