Access index of $parent in knockout.js

前端 未结 2 1730
离开以前
离开以前 2020-12-12 18:39

In knockout.js 2.1.0, in a template using the foreach binding, you can access the current item\'s index though the $index() function. In a nested foreach binding, is there a

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-12 19:23

    The easiest way you can find out is download "knockout context" for chrome. This shows you what data is bound to what element and also lets you see the available functions/variables to that particular bound element. It's an amazing tool for situations like these.

提交回复
热议问题