Meteor template Blaze how to return only first element of array

早过忘川 提交于 2019-11-30 16:49:54

问题


For example I have an array: var arr = ['a', 'b'] and want to get only first element in template


回答1:


Use {{arr.[0]}}. And this is now at least 30 characters.

https://github.com/meteor/meteor/blob/devel/packages/spacebars/README.md#identifiers-and-paths



来源:https://stackoverflow.com/questions/28630316/meteor-template-blaze-how-to-return-only-first-element-of-array

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