tmeasday / meteor-router

MIT License
366 stars 76 forks source link

Params passed in location (/post/:param) should be available through the Meteor.Router object #119

Closed voodoohop closed 11 years ago

voodoohop commented 11 years ago

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?

tmeasday commented 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.

jareiko commented 11 years ago

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?

tmeasday commented 11 years ago

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.

jareiko commented 11 years ago

Thanks! I didn't realize this package had been deprecated.