Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partials not getting global settings object #51

Closed
remy opened this issue Jul 9, 2013 · 4 comments
Closed

Partials not getting global settings object #51

remy opened this issue Jul 9, 2013 · 4 comments

Comments

@remy
Copy link

remy commented Jul 9, 2013

Inside a view, in express, you can access the application settings via settings.foo, but once a partial is included, that partial doesn't get the settings object.

Simple test with:

hbs.registerHelper('log', function (context) {
  console.log(context);
});

Then in the index.hbs:

{{#log settings}}{{/log}}
{{> subpage}}

And subpage.hbs:

{{#log settings}}{{/log}}

I would expect the same express internals regardless of whether I'm at the top level or not.

@monteslu
Copy link

monteslu commented Oct 9, 2013

+!
Just hitting this same issues. I think it works for partials in the layout, but not in other views.

@scottgonzalez
Copy link
Contributor

I'm having a similar issue with views that are rendered with data. response.render( "view" ) has the app.locals values available, but response.render( "view", data ) doesn't.

@defunctzombie
Copy link
Collaborator

Please provide a simple test app that shows desired behavior.

@scottgonzalez
Copy link
Contributor

I built a barebones app but it worked. I then started stripping away code from my actual project and found my problem. The data I was passing to the view has a name collision with the app.locals data. Sorry for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants