AngularJS access to $first of ngRepeat parent in a

2019-07-07 07:24发布

I'm trying to get access to $first of a ngRepeat parent from within a nested ngRepeat. Is there a way to alias or access $first for use within nested ngRepeat? I've tried $parent.$first, but it doesn't appear to work. Outputting to screen by interpolation indicates it has the same value as the $first of the nested child.

$parent.$first // same value as nested child

1条回答
Melony?
2楼-- · 2019-07-07 07:33

Yeesh, you have to go up two-levels to access the ngRepeat parent directive:

$parent.$parent.$first
查看更多
登录 后发表回答