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

Allow bind context for view handler #1380

Merged
merged 2 commits into from
Feb 10, 2014
Merged

Allow bind context for view handler #1380

merged 2 commits into from
Feb 10, 2014

Conversation

evilpacket
Copy link
Contributor

Allowing the view handler to accept a bind context makes it quite simple to pass in alternative context when you don't want params, etc.

Also this PR would not be possible without big <3's from @nlf

@nlf
Copy link
Member

nlf commented Feb 2, 2014

It was my suggestion here to intentionally ignore the request._route.env.bind context so that defaults set with something like plugin.bind don't apply, since there's a likelihood that's not what you want to pass to your view. So it's explicit bind on the route, or default behavior. Thoughts?

@hueniverse hueniverse added this to the 2.2.0 milestone Feb 10, 2014
@hueniverse hueniverse self-assigned this Feb 10, 2014
@hueniverse
Copy link
Contributor

It's confusing using route bind as view context. Instead, I'm changing it to simply accept a handler with { view: { template: 'test', context: { message: 'hi' } } }.

hueniverse pushed a commit that referenced this pull request Feb 10, 2014
Allow bind context for view handler
@hueniverse hueniverse merged commit b51594a into hapijs:master Feb 10, 2014
hueniverse pushed a commit that referenced this pull request Feb 10, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants