angularjs - ng重复索引不适用于jade mixin
问题描述
我将angularJS 1.5.8
ng-repeat 与一组搜索数据一起使用。我试图$index
在 ng-repeat 中传递 on mixin。它显示为空。当我通过控制器内部的 $scope 声明变量对象并传递给 Mixin 时,它与变量一起工作,但$index
没有。
玉
ul
li(ng-repeat='p in searchData')
span
| Before Mixin: $index
+AddItem($index)
米信
mixin AddItem($index)
span
| Inside Mixin: {{ $index }}
输出
Before Mixin: 0
Inside Mixin:
Before Mixin: 1
Inside Mixin:
解决方案
推荐阅读
- php - 致命错误:未捕获的 TypeError:无法访问字符串上类型字符串的偏移量
- html - css和html没有连接
- java - 使用 Junit5 和 Mockito 比较 2 个 Json 字符串
- java - 用不同数量的字符串词解析行
- python - 基于 Mozilla Authentication 使用 python 发出 API 请求
- javascript - 有什么方法可以正确显示 IDN?
- c - 如何将指针传递给函数并在那里创建一个以指针为起始地址的矩阵?
- javascript - 如何让不和谐机器人在它所在的服务器中发送消息?
- python - 如何使每个类的语义分割模型 (Sagemaker) 输出与我的训练掩码具有相同的颜色?
- liquibase - How to prevent failure to provide Liquibase Context in PROD?