Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng-repeat on table column

So I have a List that I am returning from rest service. Now, I want to display this object in column format and now in row one. So it would be something like this:

 firstName:   Bob              Alice
 LastName:    Doe              Joe
 EmailId:     [email protected]      [email protected]
 ContactNo:   123123           12444

So how can I use ng-repeat over here:

  <tr> 
     <th>firstName:</th>
     <td>('Name should be displayed here')</td>
  </tr>
like image 819
Akshay Avatar asked Sep 05 '14 23:09

Akshay


1 Answers

You can use ng-repeat on the td element.

<tr>
    <th>firstName:</th>
    <td ng-repeat="person in people">{{person.firstName}}</td>
</tr>
<tr>
    <td ng-repeat="person in people">{{person.lastName}}</td>
</tr>
like image 148
Tom Avatar answered Sep 27 '22 21:09

Tom