2016-12-28 3 views
2

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で、プロジェクトを初期化するときメッセージが表示さ:流星モジュールが追加され.meteor/packagesファイルで

Property 'publishComposite' does not exist on type 'typeof Meteor' 

angular2-compilers 
accounts-password 
msavin:mongol 
reywood:publish-composite 

私の流星プロジェクトの使用Angular2

私は何か助けていただきありがとうございます。よろしく。

+1

このコードはサーバーで実行されていますか? '.publishComposite()'はクライアントで利用できません。 –

+1

はい、サーバー上で実行されています –

答えて

0

私は同じ問題があります。私も流星のためtypescriptですを使用してい Meteor["publishComposite"] (...) 代わりの Meteor.publishComposite (...)

よう

私のソリューションを見て、私はその(まだ)コンボを賭けないと思います。

関連する問題