Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find name "JobCollection" #232

Open
GuofuHuang opened this issue May 4, 2017 · 4 comments
Open

Cannot find name "JobCollection" #232

GuofuHuang opened this issue May 4, 2017 · 4 comments
Labels

Comments

@GuofuHuang
Copy link

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?

@vsivsi
Copy link
Owner

vsivsi commented May 4, 2017

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

@vsivsi vsivsi added the question label May 4, 2017
@gh0st
Copy link

gh0st commented May 22, 2017

@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?

@mibto
Copy link

mibto commented Jun 9, 2017

@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 ;)

@pedrofg
Copy link

pedrofg commented Mar 1, 2018

import { JobCollection, Job } from 'meteor/vsivsi:job-collection';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants