【发布时间】:2016-01-21 20:38:30
【问题描述】:
我正在使用来自https://angular-ui.github.io/bootstrap/#/datepicker 的代码示例,当我尝试将其集成到应用程序时,开发人员控制台中没有错误。
$scope.open = function($event) {
$scope.status.opened = true;
};
html:
<p class="input-group">
<input type="text" class="form-control"
uib-datepicker-popup="{{format}}"
ng-model="PublishedDate"
is-open="status.opened"
show-weeks="true"
class="well well-sm"
custom-class="getDayClass(date, mode)"
close-text="Close" />
<span class="input-group-btn">
<button type="button" class="btn btn-default"
ng-click="open($event)">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
</p>
此方法在控制器中执行并设置$scope.status.opened = true;,但不显示日历。有人可以说我哪里做错了吗?
【问题讨论】:
-
你可以为你的日期选择器包含你的 html 吗?
-
-
在 $scope.open 方法中,添加
$event.stopPropagation()和$event.preventdefault(),它可能会起作用...我在许多网站上都找到了相同的解决方案。
标签: angularjs calendar angular-ui-bootstrap