I've been trying to get a seemingly simple Handlebars helper in place so that I can mark an element as active in an {{each}} block if it's ID matches that of the selected one.
Here's one attempt using some helper I found online.
Handlebars.registerHelper('ifequal', function (val1, val2, fn, elseFn) {
console.log(val1);
console.log(val2);
if (val1 === val2) {
return fn();
} else if (elseFn) {
return elseFn();
}
});
A friend of mine also has a fiddle for a more 'Handlebars-way' attempt.
So before everyone tells me to wrap my element in a view and use didInsertElement or something, let me ask my actual question: Are handlebars helpers in ember broken in this instance? My helper is expecting a value and it's getting a string. Is that expected behaviour?