问题
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}}
回答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.
来源:https://stackoverflow.com/questions/36808963/using-the-es6-spread-operator-in-htmlbars