Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 是否将'this.data'的上下文转移到Blaze/Meteor中的其他模板?_Javascript_Meteor_Meteor Blaze - Fatal编程技术网

Javascript 是否将'this.data'的上下文转移到Blaze/Meteor中的其他模板?

Javascript 是否将'this.data'的上下文转移到Blaze/Meteor中的其他模板?,javascript,meteor,meteor-blaze,Javascript,Meteor,Meteor Blaze,我有一条收集数据的路线 Router.map(function () { this.route('Players.guild', { path: '/players/guild/:guildId', template: 'GuildPlayerList', waitOn: function () { return Meteor.subscribe('guild_players', this.params.guildId); }, data:

我有一条收集数据的路线

Router.map(function () {
  this.route('Players.guild', {
    path: '/players/guild/:guildId',
    template: 'GuildPlayerList',
    waitOn: function () {
      return Meteor.subscribe('guild_players', this.params.guildId);
    },
    data: function () {
      return Players.find({ guildId: this.params.guildId });
    }
  });
});
然后,我有一个简单的模板

template(name="GuildPlayerList")
  +ionList
    +each this
      +ionItem avatar=true ion-data-modal="_playerModalView"
        img(src="{{ imageId store='PlayerThumbnails' }}" alt="{{ name }}")
        h2 {{ name }}

template(name="_playerModalView")
  // I want the current player in the +each to push its context of this here
  +ionModal title="{{ name }}"

然而,问题是,当我加载模态时,这个上下文似乎发生了变化。在其他情况下,我使用了u.bind来推送上下文,但是如何使用blaze模板来实现这一点呢?

我没有完全遵循您的语法,您也没有解释ion的内容是什么,但是在常规html语法中,您可以简单地为动态包含的模板提供一个数据参数,如中所述 ,因此在您的情况下,但html语法:

{{> _playerModalView data=this}}

您在模板中使用的语法是什么?