У меня проблемы, когда я пытаюсь использовать meteor-publish-composite
. Я вижу эту страницу https://github.com/englue/meteor-publish-composite и я выполнить следующий код в моем метеорном проекте:метеор опубликовать композитный не
meteor add reywood:publish-composite
создать публикацию-сложную функцию, как это:
import { Meteor } from 'meteor/meteor';
import { Categories } from '../../../../both/collections/administration/category.collection';
import { Structures } from '../../../../both/collections/administration/structure.collection';
//Meteor.publish('categories',() => Categories.find());
Meteor.publishComposite('categoriesWithStructures', {
find:() => {
return Categories.collection.find();
},
children: [{
find:(category) => {
console.log(category);
return Structures.collection.find({_id: category.structure});
}
}]
});
Но когда я инициализировать проект, в консоли I увидеть сообщение:
Property 'publishComposite' does not exist on type 'typeof Meteor'
В .meteor/packages
файл добавлен модуль метеор
angular2-compilers
accounts-password
msavin:mongol
reywood:publish-composite
My meteor проект использование Angular2
.
Буду признателен за любую помощь. С уважением.
Этот код работает на сервере? '.publishComposite()' не будет доступен на клиенте. –
Да, работает на сервере –