根据文件输入[时间]:
https://docs.angularjs.org/api/ng/input/input%5Btime%5D
它应该足以使用输入类型时间并将其绑定到日期对象,但它不能像我期望的那样工作.
<input ng-model="time" type="time" placeholder="HH:mm" min="08:00" max="17:00" required >
和
$scope.time = new Date();
结果我想在输入字段中看到HH:mm.
这是一个可以玩的小提琴:
解决方法
我认为你至少需要Angular 1.3.0测试版,因为它看起来像是当时推出的.
…
Features
input: support types date,time,datetime-local,month,week (07001,07002) ….