Closed voodoohop closed 11 years ago
The idea is that exact format of the route parameters isn't something that the template should care about. Theoretically a template could be rendered by many different routes, and the session is the more logical place to federate the various options that the routes might need.
I don't think it's appropriate to use Session for passing route parameters to templates. Session is "sticky," and the parameters will hang around permanently. This is wasteful and may hide errors or cause unexpected behavior.
Is there any other way to pass data from the route to the template?
I'd suggest taking a look at Iron Router -- the idea of the data
option is basically for this exact purpose--passing information into the template that you render.
Thanks! I didn't realize this package had been deprecated.
i don't understand why we need to use sessions for this. they could be easily made available in router_client.js just as page() returns the current page.
is there any reason you are using session for this?