-
Notifications
You must be signed in to change notification settings - Fork 39
Template.dynamic appears to be broken #75
Comments
can you give a hint where this can be fixed? |
I can't get it to work here. Do you have a working example where you put a real template for "template"? Thanks. |
Since meteor-jade is just an other syntax than spacebars, I test this package by writting two templates one using spacebars and the other using jade, and by checking that both template compile to the exact same JavaScript code, which is the case here. Do you have an example of template inclusion not working with jade but working with spacebars? (Otherwise it's probably a bug somewhere else). |
Here is an example, that works well with spacebars, but does not work in jade. Works well in HTML: templateName = 'passwordForm'
Blaze.renderWithData Template.cover, {templateName: templateName}, $('body')[0] cover.html <template name="cover">
{{> Template.dynamic template=templateName}}
</template> login.jade template(name="passwordForm")
p Some form definition here When I change cover.html to cover.jade: template(name="cover")
+Template.dynamic(template=templateName) I have this in console: Error thrown here (spacebars-runtime.js:23): var view = Blaze.View('Spacebars.include', function () {
var template = templateVar.get();
if (template === null)
return null;
if (! Blaze.isTemplate(template))
throw new Error("Expected template or null, found: " + template);
return template.constructView(contentFunc, elseFunc);
}); templateVar.get() function returns undefined. But I do not understand why. |
Upgrading to |
Hum, maybe that's why I cannot reproduce it, and why the test pass :) |
Thanx, upgrading to |
Sorry sorry never mind, I am a dork. Case issue: Template not template. DISREGARDSorry to bump a closed issue but I am having this problem (0.4.1). +template.dynamic(template='hello') I tested it in a fresh meteor app with the initial html file converted to jade:
The crazy thing is this works: +UI.dynamic(template='hello') I am on METEOR@1.1.0.2 |
Ui.dynamic
has been replaced withTemplate.dynamic
. However, this:Gives me this error:
Expected template or null, found: undefined
{{> Template.dynamic template=template}}
Works correctly if it's in an
.html
file, but not when it's in a.jade
file.The text was updated successfully, but these errors were encountered: