I'm having trouble with Ember.HTMLBars.makeBoundHelper. I ran ember g helper format-date, which emitted app/helpers/format-date.js (see below). Note that it uses Ember.HTMLBars.makeBoundHelper. The helper function expects a Date and a format String.
When I render the template (see below), the helper receives instead
- an
Arrayof the form[ Sat Feb 28 2015 16:00:00 GMT-0800 (PST), "MMMM YYYY" ] - an empty
Object - an
Objectof the form{ morph: Morph } - an
Objectof the form{ data: Object, dom: DOMHelper, helpers, Object, hooks: Object, useFragmentCache: true: view: undefined }
If I change Ember.HTMLBars.makeBoundHelper to Ember.Handlebars.makeBoundHelper, the helper function receives
- a
Date "MMMM YYYY"
Tracing the call stack back a bit, I hit https://github.com/emberjs/ember.js/blob/v1.11.0/packages/ember-htmlbars/lib/system/make_bound_helper.js#L70, with fn === formatDate
I was also stuck like James, his issue led me to this gist.
I'm trying to spike something, so I've left a big TODO warning for myself, but I made the last example 'work' by altering the extraction; it's far from pretty and will be tedious to apply to all helpers:
...it works, till we discover 'how'.