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
Easy way to force no data context in templates #5459
Comments
Can you give me more details and some examples of how a proposed system would work? Is it as simple as a block helper like |
Hm, now that I think about, isn't this the same as So does Maybe the issue then with Blaze is that default should be that |
Yeah I think that would be a great default, but would surely break tons and tons of apps. |
The solution is simple: <template name="foo" version="2.0">
...
</template> |
Yeah, we considered that for sure. It wouldn't be hard to make that possible with that PR for template attributes! |
Exactly what I had in mind as well. :-) |
Maybe an intermediate thing would be that you could somehow signal to the included template if data context was passed explicitly or was inherited. So that you could do something like Because then I could implement this in Blaze Components probably. Even without arguments support in templates. |
Oh, interesting. Maybe you could hackily detect if the parent view is a |
Not sure if that is possible because for example Blaze Layout use the same code as spacebars generated code. So there is no real way to distinguish between those. Maybe |
On the other hand, I am not sure which approach is better. I am using this approach in my app to clear the data context currently. So not sure which approach (using |
Oh, in fact this together with #5095 would make wonders. :-) You could build your own custom data context any way you want. |
Closing in favor of meteor/blaze#113. |
Maybe one issue with Blaze is that it is hard to say that you do not want a given data context to continue. You can easily set it to something with
#with
, but it is unclear how to force it to no data context.The text was updated successfully, but these errors were encountered: