Using the es6 spread operator in htmlbars

喜夏-厌秋 提交于 2019-12-13 01:24:40

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!