Question: ng-repeat works wrong AngularJS

Question

ng-repeat works wrong AngularJS

Answers 1
Added at 2016-12-28 11:12
Tags
Question

Get an array from server like this:

enter image description here

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?

Answers to

ng-repeat works wrong AngularJS

nr: #1 dodano: 2016-12-28 11:12

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>
Source Show
◀ Wstecz