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

On devel, Template.instance() doesn't work inside Template.body #3631

Closed
stubailo opened this Issue Feb 3, 2015 · 1 comment

Comments

Projects
None yet
1 participant
@stubailo
Contributor

stubailo commented Feb 3, 2015

If you call Template.instance() inside a helper on Template.body, it throws an exception because the body template doesn't have an associated View.

@stubailo

This comment has been minimized.

Contributor

stubailo commented Feb 3, 2015

Reproduction copied from @rclai:

if (Meteor.isClient) {
  Template.body.created = function () {
    this.test = 'huh'
  };

  Template.body.helpers({
    huh: function () {
      return Template.instance().test;
    }
  });
}

<body>
  {{huh}}
</body>

@stubailo stubailo self-assigned this Feb 24, 2015

stubailo added a commit that referenced this issue Feb 25, 2015

Make Template.body be a normal template
Fixes #3631
Instead of a collection of top-level views, which it was before

@stubailo stubailo closed this in d5a278d Feb 25, 2015

martijnwalraven pushed a commit that referenced this issue Feb 22, 2016

Make Template.body be a normal template
Fixes #3631
Instead of a collection of top-level views, which it was before
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment