nested ng-repeat for object within an object within an object

后端 未结 1 789
陌清茗
陌清茗 2020-12-12 00:07

I want to achieve the above image using angular-js ng-repeat. i got a problem for the third column.

相关标签:
1条回答
  • 2020-12-12 00:39

    Found an answer, not quite good since it keeps repeating the tbody but its still ok

    <div class="row-fluid" style="padding-top: 2%">
    <div tasty-table
         bind-resource-callback="showTCS.loadAllTCS"
         bind-init="showTCS.init"
         bind-filters="showTCS.listParams"
         bind-reload="showTCS.reloadCallback">
        <table class="table table-striped table-condensed table-hover table-bordered table-overflow"
               cellpadding="4"
               cellspacing="4"
               align="center">
            <thead tasty-thead bind-not-sort-by="showTCS.notSortBy"></thead>
            <tbody ng-repeat="tcs in rows">
                <tr ng-repeat="category in tcs.category">
                    <td class="text-center" style="vertical-align:middle;">{{tcs.trackName}}</td>
                    <td class="text-center" style="vertical-align:middle;">{{category.categoryName}}</td>
                    <td>
                        <ul class="list-unstyled" >
                            <li ng-repeat="skill in category.skill">{{skill.skillName}}</li>
                        </ul>
                    </td>
                    <td align="center">
                        <a ui-sref="mainCategoryDetails( {mainCatId: mainCategory.mainCat_id} )" class="glyphicon glyphicon-eye-open"></a>
                        <a ui-sref="editMainCategory( {mainCatId: mainCategory.mainCat_id} )" class="glyphicon glyphicon-edit"></a>
                        <a ui-sref="deleteMainCategory( {mainCatId:  mainCategory.mainCat_id} )" class="glyphicon glyphicon-minus-sign"></a>
                    </td>
                </tr>
                <tr>
                    <td ng-if="(!rows.length)" colspan="4" class="text-center">No results found.</td>
                </tr>
            </tbody>
        </table>
        <div tasty-pagination bind-items-per-page="showTCS.itemsPerPage" bind-list-items-per-page="showTCS.listItemsPerPage"></div>
    </div>
    

    0 讨论(0)
提交回复
热议问题