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

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

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

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

stubailo opened this issue Feb 3, 2015 · 1 comment
Assignees

Comments

@stubailo
Copy link
Contributor

@stubailo 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
Copy link
Contributor Author

@stubailo 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 stubailo closed this in d5a278d Feb 25, 2015
martijnwalraven pushed a commit that referenced this issue Feb 22, 2016
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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant