Meteor package and private template


#1

Hello,
In a package meteor I defined a template ‘meteorErrors’ which itself includes another template 'DIVAFF’
in “packages/errors/errors_list.html”

<template name="meteorErrors">
    {{> DIVAFF }}
</template>

in “packages/errors/errors_list_template.html”

<template name="DIVAFF">
    <div style="position:relative; top:100px; left:100px; width:300px; height:100px; background-color:red; color: #FFF;">
        DIVAFF METEOR ERRORS TEMPLATE
    </div>
</template>

in “packages/errors/package.js”

Package.onUse(function(api) {
  api.versionsFrom('1.5.2');
  api.use('ecmascript');
  api.use(['minimongo', 'mongo-livedata', 'templating'], 'client');
  api.addFiles(['errors.js', 'errors_list_template.html', 'errors_list.html', 'errors_list.js'], 'client');
  if (api.export) {
      api.export('Errors');
      api.export('affichage');
  }
});

Without doing anything the 2 templates are exported and accessible from the outside.
How to ensure that only the ‘meteorErrors’ template is exported and accessible from outside

Thank you for your help.
YC


#2

I haven’t used meteor for a year or two, but I don’t think that’s possible. Templates are (at least were) added to global ’Template’ object, I don’t think you can change that.


#3

Thank you for that answer.
Indeed I believe that the templates are always global.
This may be a future feature
Thank you
YC