使用子 slug ng-repeat获取父项的值
Get value of parent item using child slug ng-repeat
我被困在使用子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>
相关文章:
- angularJS从ng-repeat获取类名
- 如何获取 ng-repeat 输入 angularjs 的值
- 获取 ng-init 和 ng-repeat 中的元素
- 从数据库中获取数据,并在 AngularJS 中的 ng-repeat 中使用它
- 如何在AngularJS(ng-repeat)中获取选定的单选按钮数据
- 角度 - 在不使用 ng-repeat的情况下获取数据长度
- Angular - ng-repeat - 获取 1 个列表中的所有 json 子数据
- 使用 ng-repeat获取具有不同名称的嵌套对象的值
- 如何在使用 ng-repeat(ng-repeat)时获取元素的正确高度和偏移值
- 如何将特定信息从外部 API 获取到我的 ng-repeat
- 使用角度 js 获取 ng-repeat 内的总和值
- 使用子 slug ng-repeat获取父项的值
- 获取 Angular JS 中单选按钮中选中的单选按钮的值,该值为 ng-repeat
- 如何使用 ng-repeat 和过滤器来获取 JSON 数据
- 在angular指令中获取ng-repeat complete
- 在ng-repeat中获取ng-repeat的索引
- 获取ng-repeat中的row's索引(或id),以便对特定行执行一些操作
- AngularJS:如何在编译之前获取ng-repeat指令模板
- Angular -获取ng-repeat对象
- 使用toISOString()获取ng-repeat中的epoch日期