当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - ng-repeat works wrong AngularJS

问题描述:

Get an array from server like this:

Need to display: info like this

<div class="object1">

<div class="content"></div>

<div class="content"></div>

<div class="content"></div>

</div>

<div class="object2">

<div class="content"></div>

<div class="content"></div>

</div>

Now it work like that:

<div class="object1">

<div class="content"></div>

</div>

<div class="object1">

<div class="content"></div>

</div>

<div class="object2">

<div class="content"></div>

</div>

<div class="object2">

<div class="content"></div>

</div>

There My ng-repeat:

<div class="feedback-container">

<div ng-repeat="feedback in datasfeed | filter:keyword.classname " >

{{feedback.id}}

<div ng-repeat="content in feedback.content" class="feedback-row gt-clear group group-content" >

<div class="gt-left">

<div class="ava-round-small"><img src="{{content.user_avatar}}"></div>

</div>

</div>

</div>

</div>

So how to change code that it will be set How I need?

网友答案:

I would do this like that

  <div class="feedback-container">
    <div ng-repeat-start="feedback in datasfeed | filter:keyword.classname " >
        {{feedback.id}}  
    </div>
    <div ng-repeat-end ng-repeat="content in feedback.content" class="feedback-row gt-clear group group-content" >
        <div class="gt-left">
            <div class="ava-round-small"><img src="{{content.user_avatar}}"></div>
        </div>
    </div>
</div>
分享给朋友:
您可能感兴趣的文章:
随机阅读: