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
Blaze example of "Helper calculates which template to display, passing a data context to the template" doesn't actually work. #2123
Comments
Hey @tmeasday -- excellent point, thanks! We're fixing this by replacing these examples with
(where This will be on devel soon and out in the next release, at which point we'll update the wiki. |
This looks great @estark37 |
That seems like an ideal solution @estark37 |
Glad to hear it -- @avital's idea :) |
Woot! This also fixes https://groups.google.com/forum/#!topic/meteor-talk/Hfrr0_xHv4g. |
|
I just spent half an hour figuring out that the helper passed in for the It would be great to make a note of this somewhere or maybe just support both depending on whether a string or a template component is passed in. It also appears that |
Sure, we'll look at a pull request (with tests) letting UI.dynamic accept templates in addition to template names.
|
Number 2. from here: https://github.com/meteor/meteor/wiki/Using-Blaze#templatefoo-is-not-a-function-and-does-not-return-a-string
Reproduction: https://github.com/tmeasday/blaze-example-wrong
In
Template.foo.post
,this
is set to the result ofTemplate.foo.postData
. You could work around this by settingTemplate.foo.postData = {foo: 'bar', postName: this.postName}
.Kind of crappy though, as most times
postData
would come from a collection.The text was updated successfully, but these errors were encountered: