Skip to content

Support for bound handlebars helpers #615

Closed
wants to merge 1 commit into from

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
wagenet commented Mar 26, 2012

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
smadep commented Mar 31, 2012

would this support bidirectional binding?!

@wagenet
Ember.js member
wagenet commented Mar 31, 2012

@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
wagenet commented Jun 21, 2012

@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
trek commented Jul 6, 2012

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
wagenet commented Jul 25, 2012

@nhoffmann Already there :)

@ghempton
Ember.js member
ghempton commented Aug 4, 2012

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
wagenet commented Oct 8, 2012

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
Something went wrong with that request. Please try again.