ember-addons / bootstrap-for-ember

Bootstrap for Ember.js
http://ember-addons.github.io/bootstrap-for-ember
Apache License 2.0
704 stars 103 forks source link

Handlebars subexpression support #134

Closed ashrafhasson closed 10 years ago

ashrafhasson commented 10 years ago

Hi there, is Handlebars subexpression not supported in bootstrap-for-ember? I've tried registering a bound helper to concatenate couple of values in the header of a bs-panel block, like so:

The format-title.js file exports the helper as "format-title"

export default Ember.Handlebars.makeBoundHelper(function(options) {
  return options.hash.value1 + ", " + options.hash.value2;
});

and in the bs-panel helper I used the following syntax:

{{#bs-panel heading=(format-title value1=property1 value2=property2) footer="..."}}
... content here! 
{{/bs-panel}}

but it keeps stringifying value1 and value2 and I get "value1, value2" as my title. It seems that this syntax even messes up the header's markup and the "

" is no longer rendered.

asaf commented 10 years ago

I'm not sure about this specific example but make sure you have Handlebars 1.3.0+ for sub expressions support.

ashrafhasson commented 10 years ago

@asaf apologies, I've just reviewed my code, the subexpression does work indeed, what's not working is binding the property1 and property2 values, so these two are given to the helper as strings. Not sure if this is a problem with bs-panel itself though, probably not.

asaf commented 10 years ago

ye this has nothing to do with the panel, feel free to reopen with an example if u haven't found a way to do it.