I'm trying to get a seemingly simple Handlebars helper so that I can mark an element as active in the {{each}} block if it matches the identifier of the selected one.
Here is one attempt using some kind of helper that I found on the Internet.
Handlebars.registerHelper('ifequal', function (val1, val2, fn, elseFn) { console.log(val1); console.log(val2); if (val1 === val2) { return fn(); } else if (elseFn) { return elseFn(); } });
My friend also has a violin for more of the "Handlebars-way" attempt .
So, before everyone tells me to wrap the element in the view and use didInsertElement or something like that, let me ask my real question: Do steering assistants in ember help in this case? My helper expects a value and gets a string. Is this expected behavior?
source share