【发布时间】:2015-07-02 14:25:58
【问题描述】:
我的所有图像文件都来自不同的域,我将该主机名作为变量放入 Meteor.settings。那么,如何在 Meteor 模板中访问这个变量呢?
例如,在这个模板中,用 Meteor.settings 中定义的变量或其他一些全局变量替换 img.example.com 的最佳做法是什么?我认为使用帮助器将其传递给每个模板并不是一个好主意。
<template name="products">
{{#each items}}
<img src="http://img.example.com/{{id}}.png">
{{/each}}
</template>
【问题讨论】:
标签: javascript meteor spacebars