0
我在做什么是我有职位ngRepeat,我有另一个意见。我不能得到这些帖子的评论,除非我有一些如何将帖子的ID传递到ngRepeat注释中。如何将一个ID从一个ngRepeat传递给另一个?
<div ng-app="posts" ng-controller="PostCtrl">
<div id="posts_container" ng-repeat="post in posts">
<div id="the_post">
<!-- I've got to pass the post.id to get the right comments for that post -->
<div id="the_comments" ng-repeat="comment in comments">
</div>
</div>
</div>
</div>
这在PHP foreach循环中很简单,但我没有在angularjs中弄清楚它。嵌套ng-repeat也很好吗?谢谢你的帮助。
哇这么简单,它的作品就像一个魅力谢谢你的回答。 – dragonfire1119