angular-moment-meteor Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached
angular-moment-meteor Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached
我正在使用 angular-moment-meteor 并且当我使用 am-time-ago
指令时,如下所示,我就是那个错误。
<time am-time-ago="post.uploadedAt"></time>
Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [[{"msg":"post.uploadedAt","newVal":"2015-07-29T01:14:19.873Z","oldVal":"2015-07-29T01:14:19.873Z"},{"msg":"post.uploadedAt","newVal":"2015-07-29T01:11:57.581Z","oldVal":"2015-07-29T01:11:57.581Z"}],[{"msg":"post.uploadedAt","newVal":"2015-07-29T01:14:19.873Z","oldVal":"2015-07-29T01:14:19.873Z"},{"msg":"post.uploadedAt","newVal":"2015-07-29T01:11:57.581Z","oldVal":"2015-07-29T01:11:57.581Z"}],[{"msg":"post.uploadedAt","newVal":"2015-07-29T01:14:19.873Z","oldVal":"2015-07-29T01:14:19.873Z"},{"msg":"post.uploadedAt","newVal":"2015-07-29T01:11:57.581Z","oldVal":"2015-07-29T01:11:57.581Z"}],[{"msg":"post.uploadedAt","newVal":"2015-07-29T01:14:19.873Z","oldVal":"2015-07-29T01:14:19.873Z"},{"msg":"post.uploadedAt","newVal":"2015-07-29T01:11:57.581Z","oldVal":"2015-07-29T01:11:57.581Z"}],[{"msg":"post.uploadedAt","newVal":"2015-07-29T01:14:19.873Z","oldVal":"2015-07-29T01:14:19.873Z"},{"msg":"post.uploadedAt","newVal":"2015-07-29T01:11:57.581Z","oldVal":"2015-07-29T01:11:57.581Z"}]]
有人知道怎么解决吗?
我解决了删除 am-time-ago
指令并在控制器上使用 moment().fromNow()
的问题,如下所示:
查看:
<time ng-bind="timeAgo(post.uploadedAt)"></time>
控制器
$scope.timeAgo = function (time) {
return moment(time).fromNow();
};
我正在使用 angular-moment-meteor 并且当我使用 am-time-ago
指令时,如下所示,我就是那个错误。
<time am-time-ago="post.uploadedAt"></time>
Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [[{"msg":"post.uploadedAt","newVal":"2015-07-29T01:14:19.873Z","oldVal":"2015-07-29T01:14:19.873Z"},{"msg":"post.uploadedAt","newVal":"2015-07-29T01:11:57.581Z","oldVal":"2015-07-29T01:11:57.581Z"}],[{"msg":"post.uploadedAt","newVal":"2015-07-29T01:14:19.873Z","oldVal":"2015-07-29T01:14:19.873Z"},{"msg":"post.uploadedAt","newVal":"2015-07-29T01:11:57.581Z","oldVal":"2015-07-29T01:11:57.581Z"}],[{"msg":"post.uploadedAt","newVal":"2015-07-29T01:14:19.873Z","oldVal":"2015-07-29T01:14:19.873Z"},{"msg":"post.uploadedAt","newVal":"2015-07-29T01:11:57.581Z","oldVal":"2015-07-29T01:11:57.581Z"}],[{"msg":"post.uploadedAt","newVal":"2015-07-29T01:14:19.873Z","oldVal":"2015-07-29T01:14:19.873Z"},{"msg":"post.uploadedAt","newVal":"2015-07-29T01:11:57.581Z","oldVal":"2015-07-29T01:11:57.581Z"}],[{"msg":"post.uploadedAt","newVal":"2015-07-29T01:14:19.873Z","oldVal":"2015-07-29T01:14:19.873Z"},{"msg":"post.uploadedAt","newVal":"2015-07-29T01:11:57.581Z","oldVal":"2015-07-29T01:11:57.581Z"}]]
有人知道怎么解决吗?
我解决了删除 am-time-ago
指令并在控制器上使用 moment().fromNow()
的问题,如下所示:
查看:
<time ng-bind="timeAgo(post.uploadedAt)"></time>
控制器
$scope.timeAgo = function (time) {
return moment(time).fromNow();
};