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

Handlebars "this" path referring to helper #1143

awwx opened this issue Jun 11, 2013 · 2 comments

Handlebars "this" path referring to helper #1143

awwx opened this issue Jun 11, 2013 · 2 comments


Copy link

@awwx awwx commented Jun 11, 2013 states:

Paths starting with this always refer to properties of the current data context and not to helpers.


  {{> hello}}

<template name="hello">
  {{#each stuff}}

if (! Meteor.isClient)

Stuff = new Meteor.Collection(null);
Stuff.insert({title: "One"});
Stuff.insert({title: "Two"});
Stuff.insert({title: "Three"});

Handlebars.registerHelper("title", function() {
  return "hello!";

Template.hello.stuff = function() {
  return Stuff.find();

displays "One hello! hello!" instead of "One Two Three" in Meteor 0.6.4.

Copy link

@dgreensp dgreensp commented Jun 20, 2013

Found the bug! When we're walking the template AST, we mutate it in place by accident (oops). Fixing on devel.

Copy link

@funkyeah funkyeah commented Jun 27, 2013

I can't explain it but in some weird way it makes me happy to know that my noob filled stackoverflow question lead to @awwx filing a bug, which lead to @dgreensp finding and fixing a bug, all so that I didn't have to change the name of a helper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants