Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49167

Ionic: forEach object/array in table row col

$
0
0

@DinioDev wrote:

Hi,
I need to set this json result:

{"57a725d68cdae8826dd1eb83":{"answer":{"answerId":"57a725d68cdae8826dd1eb83","votes":21,"imageURI":"","answerText":"No"},"users":{"56e132897719cf03008f298d":{"id":"56e132897719cf03008f298d","name":"user1","gender":"male"},"57a646f14e64cad01a73559b":{"id":"57a646f14e64cad01a73559b","name":"user2 name","gender":"female"}}},"57a725d68cdae8826dd1eb84":{"answer":{"answerId":"57a725d68cdae8826dd1eb84","votes":1,"imageURI":"","answerText":"Yes"},"users":{"56e132897719cf03008f298d":{"_id":"56e132897719cf03008f298d","name":"user5","gender":"male"}}}}

to my table column row, the thing is, Im running over the
column, and then the rows, so I cant set all results in one column, and
the other in the other column, I can think of a hack to put one real
result, and then an empty result for the first answer, then, the
opposite, but I will have to run over the object twice... any suggestions?

Here is my code:

<ion-scroll direction="x" style="width: 100%" scrollbar-x="false" delegate-handle="head" zooming="true" on-scroll="scrollMirror('head', 'list')">
                  <div class="item item-header item-asqall row row-item">
          <div class="col col-center" ng-click="sort('descricao')">Voted: Yes</div>
          <div class="col col-center" ng-click="sort('valorLiquido')">Voted: No</div>
        </div></ion-scroll>
        <ion-scroll direction="xy" style="height: 100%" zooming="true" on-scroll="scrollMirror('list', 'head')" delegate-handle="list">
          <div class="item row row-item" ng-repeat="vote in voters">
            <div class="col col-center" ng-repeat="user in vote.users">{{user.name}}</div>
          </div>
     <div class="item item-footer item-asqall row row-item">
       <div class="col col-center"></div>
     </div>
   </ion-scroll>

But as you can understand, the result is mixed of answers in each column...

What is the best way to do it?

Thank you!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49167

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>