2
我有兩個陣列,我想使用一個 對話的方式顯示它們NG-重複迭代通過兩個陣列在角JS同時
採取兩個陣列這樣
messages_send = ["hi","good, How about you?","cool","LOL","NFW"]
messages_received = ["hey, How are you?","good, Thanks","hmmm","asdfsda"]
定義
<ul>
<span ng-repeat="i in [0,1,2,3,4]">
<li>
messages_send[i]
</li>
<li>
messages_received[i]
</li>
</span>
</ul>
我這樣做,它只是問題是它搞砸了我的對話佈局。有沒有另一種方法來做到這一點我的意思是使用ng-reapet迭代兩個數組而不會搞亂佈局?
感謝
爲什麼不將它們映射到一個數組? – charlietfl