我希望在使用Angular UI Bootstrap库的组件单击按钮时有一个datepicker弹出窗口。
两者都有例子 Angular UI Boostrap 网站,但我没有看到一种方法来组合它们。我不喜欢放置Datepicker的想法 div
作为的属性值 popup
指令的文字。
我也试过用 ng-show
在Datepicker上 div
但我也不能这样做。
这是我目前的代码。
<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
战略。宁愿让它成为一个流行音乐,但我认为有办法做得更好,所以我也不介意。