Is there an easy way to display session variables in a page on metires?
It looks as if each handler outlet (for example, {{myVar}}), templates. Mytemp.myVar = Functions ... or maybe a handler assistant to display.
So every time you want to show something in Hb, you have to write a companion display function in the meteors.
Is that right?
Looks cumbersome.
In addition, whether it is an artifact Meteorjs or it requires a handler to store some variables to display. If the latter, maybe I can find such a variable place and for such things the meteor can not use the session shop.
This is the easiest way to do this, there are other ways to write it, but in all of them There must still be some kind of companion function to write because the display logic is directly HTML & amp; Do not find your way in. Assistant has separated.
Though it's a little disturbing, it's still really easy & amp; As much as the difficulty may be, the meteorite server is handled by you just after the logic right below the database. It also helps to keep the code clean & amp; Reusable.
If you are using an assistant a lot and its duplication can be used by a global assistant, then it can be reused on each template.
A second option can take options from Handlers Helper:
Handlebars.registerHelper ('session', function (name) {return Session.get (name);} ); You can then use
{{session "bar"}} {{session "varb"}} {{session "varc"} } and when you want to change them, set them to the session with the session .set .
No comments:
Post a Comment