Okay so I am using iron:router
and meteoric:ionic
together. I have been having a problem with modals (more based around meteor than the frameworks.)
Here is an example route.
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 });
}
});
});
Then, I have a simple template with a modal.
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 }}"
The problem, however, is it seems that the context of this changes when I load the modal. In other cases, I have used _.bind to push the context of this, but how can this be done with blaze templates?
I was imagining some kind of onRendered
function or something