mystor / meteor-device-detection

(NO LONGER SUPPORTED) Client-Side Device Type Detection & Template Switching with Optional Meteor-Router Support
MIT License
69 stars 17 forks source link

Passing context variables when using {{> deviceRender }} helper #14

Closed bsbechtel closed 8 years ago

bsbechtel commented 8 years ago

I know this package hasn't been touched in quite a while, but it has been very useful for my project. I was wondering if there is a way to pass variables or contexts to templates when using the deviceRender template helper. For example, I have a template, myTemplate, that requires a data context from Iron Router. Is there a way to include that data context in myTemplate when it is rendered through the deviceRender helper? Ex: {{> deviceRender 'myTemplate' data_context }}

Sojourneer commented 8 years ago

It sounds like this is similar to the issue of passing data to templates when using kadira:flow-router, as that package doesn't allow direct passing of data to a template. The recommended way with that package is to have the template's helpers lookup the data themselves based on route params available through the router object.

bsbechtel commented 8 years ago

That makes sense. I think I ended up finding a different workaround for my needs when I posted this, but I will keep this in mind in the future. Thank you.