【发布时间】:2015-04-02 03:52:39
【问题描述】:
我的应用程序不应该发布“memberPrice”字段。在我的 publish.js 文件中,我指定了不发布 memberPrice。这是我的服务器/publish.js:
Meteor.publish('cars', function() {
return Products.find({category: 'vehicle'}, {limit: 10}, {fields: {memberPrice: 0}});
});
我的控制器:
carsController = RouteController.extend({
waitOn: function () {
var sessionId = Session.get('sessionId');
console.log("Session: ", sessionId);
Meteor.subscribe('cars');
Meteor.subscribe('cartItems', sessionId);
},
action: function() {
this.render('Cars');
}
});
这是我使用 aldeed:tabular 包的表格:
TabularTables = {};
Meteor.isClient && Template.registerHelper('TabularTables', TabularTables);
TabularTables.Cars = new Tabular.Table({
name: "Cars",
collection: Products,
columns: [
{data: "productCode", title: "Product Code"},
{data: "brand", title: "Brand"},
{data: "productLineName", title: "Product Name"},
{data: "description", title: "Description"},
{data: "memberPrice", title: "Member Price"}
]
});
有人知道怎么回事吗?
谢谢!
【问题讨论】:
-
cartItems publish返回的是什么?另一个系列?还是Products collection光标?
标签: javascript meteor publish