【发布时间】:2016-06-07 12:27:04
【问题描述】:
流星 1.3: 我的项目架构是:
- .meteor
- 两者
- articles.js
- tags.js ...
- 客户端
- 模板
- templates.html
- templates.js
- 服务器
- main.js
我想将我的集合用于客户端和服务器中的一些检查,因此我使用:
import { CollectionName } from "path/to/Collection"
在客户端和服务器端
在我的收藏文件中:
export const CollectionName = new Mongo.Collection("collection");
我已经尝试使用 global.Collection 名称,在集合名称之前没有任何单词,就像在 Meteor 1.3 之前一样 -> 仍然得到:
Exception from sub articles id 2irSGEkWinCGvB33z ReferenceError: Articles is not defined
如果我只使用import './../both/collections/collectionName';,我会得到 CollectionName 未定义;
【问题讨论】:
-
您的收藏文件在哪里?
-
在两个文件夹中,还尝试将其移动到 lib 中的一个 collections.js 文件不起作用
标签: javascript meteor collections