2017-02-23 4 views
0

は、私はちょうどので、お互いの下に股関節の配列ではなく、ライン上で互いに隣の役割の内容を表示する必要があるか、私はそれが水平スクロールので、TDのその部分でのスクロールオプションを持っている必要がありimage どのように私はお互いの代わりにお互いの下に配列のオブジェクトを置くことができますか?

<tr ng-repeat="companyUser in companyUsers | filter:search | orderBy:sort"> 
    <td> 
     <nobr>{{companyUser.user.firstName}}</nobr> 
    </td> 
    <td> 
     <nobr>{{companyUser.user.lastName}}</nobr> 
    </td> 
    <td> 
     <nobr>{{companyUser.user.username}}</nobr> 
    </td> 
    <td> 
     <nobr>{{companyUser.user.role}}</nobr> 
    </td> </tr> 

私はParseとParseデータベースを使ってデータを読み込むためにParseを使いますが、主なことは、tdを水平スクロール可能にしたい、あるいはeac otherの下に置くことです。

答えて

1

<td>タグの人の役割よりng-repeatを追加します。

angular.module('app', []) 
 
.controller('ctrl', function($scope) { 
 
    $scope.data = [ 
 
    { 
 
     firstname: "User", 
 
     lastname: "Lastname", 
 
     email: "[email protected]", 
 
     role: ["Role1", "Role2", "Role3", "Role4"] 
 
    }, 
 
    { 
 
     firstname: "User2", 
 
     lastname: "Lastname2", 
 
     email: "[email protected]", 
 
     role: ["Role1", "Role2", "Role3", "Role4"] 
 
    } 
 
    ] 
 
})
<!DOCTYPE html> 
 
<html> 
 

 
    <head> 
 
    <script data-require="[email protected]" data-semver="1.6.0" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.0/angular.js"></script> 
 
    <link rel="stylesheet" href="style.css" /> 
 
    <script src="script.js"></script> 
 
    </head> 
 

 
    <body ng-app="app" ng-controller="ctrl"> 
 
    <table> 
 
     <tr> 
 
     <th>First name</th> 
 
     <th>Last name</th> 
 
     <th>Email</th> 
 
     <th>Roles</th> 
 
     </tr> 
 
     <tr ng-repeat="person in data"> 
 
     <td>{{person.firstname}}</td> 
 
     <td>{{person.lastname}}</td> 
 
     <td>{{person.email}}</td> 
 
     <td><div ng-repeat="role in person.role">{{role}}</div></td> 
 
     </tr> 
 
    </table> 
 
    </body> 
 
</html>

関連する問題