javascript - AngularJS ng-repeat in this model -


i want know if possible use ng-repeat in model this:

example model:

$scope.items = {    item1:{[1,2,3,4,5]},    item2:{[a,b,c,d,e]},    item3:{[a1,b2,c3,d4,e5]} }; 

the table should using ng-repeat:

------------------------- | item1 | item2 | item3 | ------------------------- |   1   |     |   a1  | |   2   |   b   |   b2  | |   3   |   c   |   c3  | |   4   |   d   |   d4  | |   5   |   e   |   e5  | ------------------------- 

if not possible using model, can please suggest alernatives? appreciated. in advance.

you can change data model this

function ctrl($scope) {     $scope.items = [{         item1: 1,         item2: 'a',         item3: 'a1'     }, {         item1: 2,         item2: 'b',         item3: 'b2'     }, {         item1: 3,         item2: 'c',         item3: 'c3'     }, ...]; }  <div ng-app ng-controller="ctrl">     <table>         <tbody>             <th>item1</th>             <th>item2</th>             <th>item3</th>             <tr ng-repeat="item in items">{{item}}                 <td>{{item.item1}}</td>                 <td>{{item.item2}}</td>                 <td>{{item.item3}}</td>             </tr>         </tbody>     </table> </div> 

demo


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -