Skip to content
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

[1.3-beta1] import Blaze template not include helper, onRendered, onCreated. #5831

Closed
bySabi opened this issue Dec 19, 2015 · 2 comments
Closed
Milestone

Comments

@bySabi
Copy link

bySabi commented Dec 19, 2015

Hi @benjamn I was trying to include a Blaze template this way:

import './hello.html';

It work fine but helpers and onRendered, onCreated is not imported.

I create a repo: https://github.com/bySabi/Blaze_template_import__on_1.3-beta.1

@avital
Copy link
Contributor

avital commented Jan 21, 2016

Yes, importing the .html file can't know where the .js file that defined helper is located. Am I missing something? How did you expect this to work?

@benjamn
Copy link
Contributor

benjamn commented Jan 21, 2016

Package files that are not explicitly added with api.addFiles or imported by the main module (or one of its dependencies) will not be eagerly evaluated.

I believe in this case client.js should also explicitly import hello.js:

import "./hello.html";
import "./hello.js";

Please reopen if that doesn't fix the problem.

@benjamn benjamn closed this as completed Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants