Support for bound handlebars helpers #615

Closed
wants to merge 1 commit into
from

Projects

None yet

5 participants

@ghempton
Ember.js member

This is my first attempt at adding a convenient way to create bound handlebars helpers. Bound handlebars helpers can now be created as follows:

  Ember.Handlebars.registerBoundHelper('capitalize', function(value) {
    return value.toUpperCase();
  });

Would love some feedback as to how this could be cleaned up.

@wagenet
Ember.js member

This is based on the BoundProperty stuff I did right? If so, and if we merge this, should we change basic property bindings to use this as well?

@smadep

would this support bidirectional binding?!

@wagenet
Ember.js member

@smadep No. If you want to bind to the DOM you have to do some extra work. As an example, the TextSupport mixin handle this for TextField and TextArea: https://github.com/emberjs/ember.js/blob/master/packages/ember-handlebars/lib/controls/text_support.js

@wagenet
Ember.js member

@ghempton I think it would definitely be useful to get something like this in core. However, I know there was some concern from @wycats about the way rendering is handled here. @wycats, any more thoughts on the matter?

@trek
Ember.js member

this isn't on the 1.0 milestone, but probably should be.

@nhoffmann

+1 for putting this on the 1.0 milestone

@wagenet
Ember.js member

@nhoffmann Already there :)

@ghempton
Ember.js member

I'd be happy to take another pass on this. What is the desired implementation? I think @wycats was wanting to reuse the code path from {{bind}}, but I'm wary of making Ember._HandlebarsBoundView more complex.

@ghempton ghempton referenced this pull request Aug 15, 2012
Merged

Bound handlebars helpers #1274

@wagenet
Ember.js member

Closing in favor of #1274,

@wagenet wagenet closed this Oct 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment