【发布时间】:2013-04-04 12:24:56
【问题描述】:
当我升级 ng-repeat 时,加载时间非常长,并尝试显示更多内容框,而没有 $resource 提供的内容。
我已将问题缩小到 1.1.0 和 1.1.1 之间的更新。我查看了更新日志,但没有任何内容表明我是罪魁祸首,但它一定在里面。
更新日志 => https://github.com/angular/angular.js/blob/master/CHANGELOG.md#111-pathological-kerning-2012-11-26
此应用的存储库 => https://github.com/brianpetro/resume
目前我的角度看起来像:
app = angular.module("Resume", ["ngResource"])
app.factory "Entry", ["$resource", ($resource) ->
$resource("/entries")
]
@EntryCtrl = ["$scope", "Entry", ($scope, Entry) ->
$scope.entries = Entry.query()
]
这发生在使用 ng-repeat 的多个视图上:
<html ng-app="Resume">
<div ng-controller="EntryCtrl">
<ul>
<li ng-repeat="entry in entries">
{{entry.title}}
</li>
</ul>
</div>
</html>
这是 AngularJS 版本 1.1.0: 这是 AngularJS 版本 1.1.1:
【问题讨论】:
-
/echo/json正在返回{}所以我不得不用模型替换你的资源(使用超时)。我看不出 ng-repeat 有任何问题。 Fiddle.
标签: javascript angularjs angularjs-ng-repeat angular-resource