使用子 slug ng-repeat获取父项的值

Get value of parent item using child slug ng-repeat

本文关键字:获取 ng-repeat slug      更新时间:2023-09-26

我被困在使用子ng-repeat slug获取父ng-repeat值。它什么都不显示,只是空白的 td

我做了什么

$scope.column = [column_id: "12"slug: "item6"sort: "0"status: "1"title: "Contact no"ts_datetime: "2014-12-12 12:27:50"];
$scope.column.item = [item1: "1"item2: "2"item3: "3"item4: "4"item5: "5"item6: "8"item_id: "1"status: "1"]
<table class="table table-bordered table-striped">
    <thead>
        <tr>
            <th ng-repeat="column in columns" >{{ column.title }}</th>
        </tr>
    </thead>
    <tbody>
        <tr ng-repeat="item in listings">
            <td ng-repeat="column in columns" ng-init="val = item.column.slug">{{ val }}</td>
        </tr>
    </tbody>
</table>

我想要的是这个。 获取带有列的辅助信息区的项目的值。喜欢 item.column.slug

看起来你想使用:

<td ng-repeat="column in columns">{{item[column].slug}}</td>