meteor-job-collection
meteor-job-collection copied to clipboard
Cannot find name "JobCollection"
I just install this package, and I'm using Angular2. But when I start the app, it said that "it cannot find name "JobCollection", anyone knows how to solve it?
If it is installed correctly, it should be globally visible. Although depending on your tooling, you may need to import
it. I recommend looking at a working sample app if you are just getting started:
https://github.com/vsivsi/meteor-job-collection-playground
https://github.com/vsivsi/meteor-file-job-sample-app
@GuofuHuang this is typical of an angular2 app and like @vsivsi said you might need to import
it. When is it that you see this message? Is it in your editor, when you start your app, in your browsers console? Can you give us some context?
@GuofuHuang problem is that typescript is not aware of the package because of a missing type declaration.
declare module 'meteor/vsivsi:job-collection' {
export class JobCollection {
constructor( databaseName: string );
find( query: Object, options?: Object );
startJobServer();
allow( options: Object );
processJobs( type: string, options: Object, worker: ( result: any, callback: any ) => void )
}
export class Job {
constructor( jobCollection: JobCollection, type: string, options: Object );
priority( priority: string ): Job;
retry( options: Object ): Job;
delay( delay: number ): Job;
save();
}
}
i never wrote one of those and i'm hoping for some help as well ;)
import { JobCollection, Job } from 'meteor/vsivsi:job-collection';