2016-12-28 56 views
4

從服務器獲取一個數組是這樣的:NG重複工作的錯誤AngularJS

enter image description here

需要顯示:像這樣

<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> 

信息現在,它的工作就像是:

<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> 

有我的重複:

<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> 

那麼如何更改它將被設置的代碼我需要什麼?

+0

雅非常好的問題問... –

+0

你可以分享小提琴..或者你的數據.. – Ved

回答

2

我會做這樣那樣的

<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>