1

我尝试Match.ObjectIncluding在 angular2-meteor1.3.1 项目中使用。

基于这个文件meteor.d.ts,我可以成功使用

import { Meteor } from 'meteor/meteor';
import { Mongo } from 'meteor/mongo';

但是,当我尝试使用

import { Match } from 'meteor/match';

我收到错误:

/Users/hongbo-miao/.meteor/packages/meteor-tool/.1.3.1.z9fvfj++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:267
                        throw(ex);
                              ^
Error: Can't find npm module 'meteor/match'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?
    at Object.Npm.require (/test/.meteor/local/build/programs/server/boot.js:195:17)
    at options.fallback (packages/modules-runtime.js:413:18)
    at require (packages/modules-runtime.js:98:16)
    at meteorInstall.collections.methods.ts (collections/methods.ts:2:1)
    at fileEvaluate (packages/modules-runtime.js:158:9)
    at require (packages/modules-runtime.js:92:16)
    at /test/.meteor/local/build/programs/server/app/app.js:905:1
    at /test/.meteor/local/build/programs/server/boot.js:283:10
    at Array.forEach (native)
    at Function._.each._.forEach (/Users/hongbo-miao/.meteor/packages/meteor-tool/.1.3.1.z9fvfj++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)

如何正确导入 Match?谢谢

4

1 回答 1

1

所以事实证明打字文件是错误的。新的类型文件在这里,它使用

'meteor/check'
于 2016-05-10T05:09:21.197 回答