peerlibrary/meteor-blaze-components

[Question] About aldeed:tabular

emehmet opened this issue · 5 comments

Template does'nt work as BlazeComponent class where Template is defined in aldeed:tabular tmpl.

for example like below:

{
    tmpl: Meteor.isClient && Template.SilPersonel
}

We defined Template.SilPersonel as BlazeComponent class but it dosen't work.

Hi @emehmet : After upgrade to meteor 1.3 I just stumbled upon the same problem... it seems like the strict mode (having to remove templating) might be the reason... in meteor 1.2 I still had blaze-html-templates@1.0.1 loaded - now in meteor 1.3 it is removed.

did you find a solution for this?

mitar commented

Hm, can somebody make a small reproduction here?

just a little update:

I got a 1.3 project with BlazeComponents installed (standard blaze-stuff is removed and replaced by blaze-components)

Case 1 (works)
... when loading eagerly (/client /lib) and doing a console.log(Template.whatever) I am seeing an array with the first element of type Blaze.Template

Case 2 (does NOT work)
... when loading non-eagerly (imports/module/client imports/modele/lib) and doing a console.log(Template.whatever) I am seeing an array with the first element of function (viewName, renderFunction).

So I am getting 2 different return types. In case 2 a Template.whatever returns undefined causing `àldeed:tabular`` to fallback to standard-mode and NOT show the template. Case 1 does work. Case 2 does NOT.

OK, I found the solution. it has NOTHING to do with BlazeComponents, but with getting to know how 1.3 modules work.

in imports/lib/tabular.js add the following to the TOP of the file:

if (Meteor.isClient) {
  require( '../client/template.html' )  // html including the cell-template
}

this will introduce the template to the namespace of the file and lets console.log(Template.whateverTemplateName) return a valid template instance.

@emehmet: does this work for you?

it doesn't work on me. But i so solded so. I use template event just for this part Template.SilPersonel.events({
but this is not a true solution.