-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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
settings locals variables on a partial no longer works #454
Comments
shit, im on it |
seems fine actually ... I just noticed you have .html.ejs, what version of express did you have before? things have changed a bit, check out http://expressjs.com/migrate.html |
I checked again - it works fine for strings and numbers, but I can't seem to access sub properties of objects. So in my case, if restaurant.data = "ok", that works, but if it's {_id: "chutneys"}, I can't access restaurant._id in the partial. |
:s weird wtf |
this test should confirm that what you are mentioning is fine...
so im not to sure :s |
OK, the reason was because I have a variable called 'restaurant' in my main view and a different on in the partial. This used to work but a recent change means local variables in a partial get overwritten if there is a variable with the same name in the main view |
ah i see. that makes sense. I should swap the precedence then |
cheers, sorry for the confusion. Was a weird looking bug, heh |
Fixed partial local inheritance precedence. Closed by 33136c6 |
no no, thanks man, it seemed like a non-issue at first, but definitely a good catch |
I just updated from tag 1.0.0rc4 and my partials no longer work properly. Example partial:
!= partial('restaurants/_restaurant_js.html.ejs', {locals: {restaurant: restaurant.data}})
In the partial, I can't access any properties of the 'restaurant' variable. But it worked fine before the upgrade. It looks like locals are no longer being set properly
The text was updated successfully, but these errors were encountered: