【发布时间】:2015-01-21 03:29:43
【问题描述】:
代码如下:
---html---
<input type="text" ng-model="pageInfo.businessHours" name="businessHours" date-formatter="object|start|end||-||HH:mm" readonly />
---js---
...
$scope.pageInfo = {
businessHours: {
start: new Date(),
end: new Date()
}
};
// when I change businessHours, the input value doesn't update
$scope.pageInfo.businessHours.start = new Date('2000-10-10'); // view doesn't update
问题是当$scope.pageInfo.businessHours 改变时,视图永远不会改变。
(date-formatter 是我的自定义指令,将两个日期对象显示为08:10-20:30。)
那么,有什么想法吗?
【问题讨论】:
标签: angularjs data-binding angular-ngmodel