meteor - How can I do something like this in a template?: {{userScores.{{currentUserId}}.[0].score}} -
this working me, hard coded: {{userscores.kxxjydlvcvjk9nlwo.[0].score}}
i want use meteor.userid() in place of hard coded id.
how can that?
of course, doesn't work; {{userscores.meteor.userid().[0].score}}
you can't directly in blaze, you'll need helper, ex:
{{score0}} js:
template.mytemplate.helpers({ score0() { return this.userscores[meteor.userid()][0].score; } });
Comments
Post a Comment