【发布时间】:2016-02-07 15:34:40
【问题描述】:
我的代码太大,这里不能贴,所以只贴相关部分。
我有一个相当大的应用程序,现在我想添加一个数据选择器。我从the Angular UI bootstrap site复制了代码。
在我的控制器中我初始化了
$scope.popup1 ={'opened': false}
$scope.dt = new Date();
并声明
$scope.open1 = function()
{
$scope.popup1.opened=true;
}
而且,在我看来,我有
<input type="text" class="form-control" uib-datepicker-popup="{{format}}" ng-model="dt"
is-open="popup1.opened" min-date="minDate" max-date="maxDate"
datepicker-options="dateOptions" date-disabled="disabled(date, mode)"
ng-required="true" close-text="Close"
alt-input-formats="altInputFormats" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open1()">
<i class="glyphicon glyphicon-calendar"></i></button>
</span>
当我点击按钮时,函数被调用并且$scope.popup1.opened被设置为true。
但是,日期选择器没有弹出。
我是否遗漏了一些明显的东西?我需要启用日期选择器或其他什么吗?
【问题讨论】:
-
当你刚刚设置为true时,is-open=true它会加载打开吗?
-
一个非常好的问题!但是,唉,不,它没有:-(
-
@Mawg.. 你找到解决方案了吗?
-
我正在使用一个框架,并被告知日期选择器与它使用的 Angular 版本不兼容(那么为什么要发布它?)。我已承诺将通过电子邮件将更新版本发送给我。
标签: angularjs datepicker