The context of “this” in Meteor template event handlers (using Handlebars for templating)

This video explains the concepts: http://www.eventedmind.com/posts/meteor-spark-data-annotation-and-data-contexts. The direct answer to your question: The thisArg inside an event handler should point to a data context. But sometimes the data context is undefined. When you use the Function.prototype.call(thisArg, …) in JavaScript, if the thisArg is undefined (e.g. a dataContext is undefined) the browser will set this equal … Read more

What are the differences between the express-handlebars, express-hbs and hbs modules,

Looks like the comment above needs to be updated a bit. Updated list is here: Express-handlebars Seems to be the most popular package at the moment. There is live chat on gitter. Dependencies are up-to date and current npm version is 3.0.0. Last update 29 days ago (at the moment of this post) One important … Read more

Using Express Handlebars and Angular JS

Your first solution is possible, AngularJS allow to change the start/end symbols of text interpolation like this: appModule.config(function($interpolateProvider) { $interpolateProvider.startSymbol(‘{[{‘); $interpolateProvider.endSymbol(‘}]}’); }); Then you could use it in your template: <div>{[{message}]}</div> Also see: $interpolateProvider documentation Hope this helps.

Handlebars.js if block helper ==

The easiest thing would be to add a custom if_eq helper: Handlebars.registerHelper(‘if_eq’, function(a, b, opts) { if(a == b) // Or === depending on your needs return opts.fn(this); else return opts.inverse(this); }); and then adjust your template: {{#if_eq this “some message”}} … {{else}} … {{/if_eq}} Demo: http://jsfiddle.net/ambiguous/d4adQ/ If your errors entries weren’t simple strings then … Read more