1

我从 xsl 翻译器获得我的 html 模板 + json 数据,它是动态的,它看起来像 html 代码加上字符串化 json 中的一些数据。问题是:我以什么方式将 json 字符串放入 html 代码中,以便控制器在 html 渲染之前捕获此 json 数据?当我简单地这样说时:

<div>{{ $scope.categories = [{},{},...]}}</div>
<div ng-repeat="category in categories" class="category">...</div>

它工作得很好,但带来了一些奇怪的错误:

Error: 10 $digest() iterations reached. Aborting!

那么将数据从视图传递到控制器的好方法是什么?

4

0 回答 0