I am trying to switch my project to an all-in-packages structure
and ran into a problem with an aldeed:tabular.
The problem is that custom-table-cells (defined within ... new Tabular.Table({... are NOT being rendered when the tabular-definition is being placed within the package (/packages/mypackage/lib/). The exact same file works when being placed within /lib/
This is an excerp of the file:
columns: [
{
data: 'this', // set data for sort-option & template-context!
tmpl: Meteor.isClient && Template.templateColumnName,
Really really strange stuff - I must be doing something wrong.
Well… strange thing is that the tubalar table itself is rendered… it just does NOT render the custom cell, just as if Template.* is undefined… maybe it is package scope?
FINALLY… what a stupid mistake and @shock was totally right - It was loading order!
And to be honest - I have lost way tooo much time on that one!!!
BIG learnings: Always load .html templates first before referencing to them in any other .js files.
This all-in-packages-structure really forces you think about that sh**…
If anyone else stumbles upon this - this is the way to do it:
// PACKAGE-DEPENDENCIES
api.use([
// LIB (Layer 1)
'lib', // loads aldeed:tabular and does ``api.imply()``
]);
// FILES
// CLIENT files
api.addFiles([
'client/table_list.html', // put this file first (containing the cell-template) first in order for ``Template.templateColumnName`` to find it
'client/table_list.js',
], 'client');
// SHARED files (client & server)
api.addFiles([
'lib/collection.js',
'lib/table.js', // table definition
]);
// SERVER files
api.addFiles([
'server/publications_and_allows.js',
], ['server']);