Nested comments in AngularJS with ng-repeat

一个人想着一个人 提交于 2019-12-05 09:59:05

SOLVED

So to count levels I'm using level variable inside ng-repeat of responses:

    <div ng-repeat="comment in responses = comment.responses | orderBy: 'created_at': true" ng-include="'comment.html'" ng-init="level = level + 1"></div>

And then on the controls I'm checking that level, e.g. to not show the control:

    ng-hide="level > 5"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!