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

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -