cibernox / ember-ast-helpers

Utility belt to level-up your Ember AST transforms
MIT License
40 stars 6 forks source link

Add option to `interpolateProperties` to wrap interpolation in helper #8

Closed cibernox closed 6 years ago

cibernox commented 6 years ago

Example:

{{fa-icon color=boundColor}}
class FaIcon extends BuildTimeComponent {
  constructor() {
    super(...arguments);
    this.styleContent = interpolateProperties('color:$color$', { divisor: '$', skipIfMissingDynamic: true });
  }
}
<i class="fa" style={{if color (concat "color:" color)}}></i>

This option by default is false, because it's a rather convoluted output for what is usually an uncommon use case (so I think, time will tell)