1

Is is possible to use the equivalent of the spread operator in htmlbars?

let items = ['hello', 'world'];
someFunction(...items); // equivalent to someFunction('hello', 'world');

I need this in htmlbars

{{link-to 'some.route' ...items}}
jax
  • 37,735
  • 57
  • 182
  • 278

1 Answers1

1

No, this is not possible afaik. I believe this PR request tries to implement it: https://github.com/wycats/handlebars.js/pull/1149. Unfortunately development on it doesn't seem to be very active.

Rengers
  • 14,911
  • 1
  • 36
  • 54
  • OK, I actually got this specific scenario working anyway because link-to supports a `params` attribute. `{{link-to params=myParams}}`. – jax Apr 23 '16 at 11:03