我对 AngularStrap 日期选择器(bs-datepicker 指令)有疑问。
当使用弹出日期选择器选择日期时 - 没问题。
当输入日期(键盘)并且输入日期格式与配置不同时,模型不会更新。我不确定这是否是它应该如何工作的,但我相信用户不会介意只输入日期而不是使用鼠标单击来选择日期。
这是我的html
<div class="control-group input-append">
<input type="text" ng-model="datepicker.date" data-date-format="dd/mm/yyyy" bs-datepicker>
<button type="button" class="btn" data-toggle="datepicker"><i class="icon-calendar"></i></button>
</div>
用户在 1998 年 1 月 1 日输入 - 没问题。
01-01-1998 中的用户类型 - 不起作用,模型没有得到更新。
这是plunker
任何帮助表示赞赏。我能想到的解决方法是将输入设为只读,但这是一个坏主意。
提前致谢。