Accessing parent context in Meteor templates and template helpers

前端 未结 9 848
别跟我提以往
别跟我提以往 2020-12-09 01:10

I\'m running into a template context situation that I\'m having a hard time finding a way around.


Here\'s the template in question:



        
9条回答
  •  温柔的废话
    2020-12-09 01:34

    It seems since Spacebars (Meteor's new template engine), you have access to the parent context within {{#each}} blocks using ../.

    In Meteor 0.9.1, you can also write a helper and use Template.parentData() in its implementation.

提交回复
热议问题