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

ReferenceError: schema is not defined #52

Closed
kurdin opened this issue Feb 20, 2016 · 3 comments
Closed

ReferenceError: schema is not defined #52

kurdin opened this issue Feb 20, 2016 · 3 comments

Comments

@kurdin
Copy link

kurdin commented Feb 20, 2016

Example from your README will throw error: ReferenceError: schema is not defined

constructor () {
 super();
 schema({
     name: String,
     valuation: {
         type: Number,
         default: 10000000000,
         min: 0
     },
     employees: [String],
     dateFounded: {
         type: Date,
         default: Date.now
     }
 });
}

right code is:

constructor () {
 super();
 this.schema({
     name: String,
     valuation: {
         type: Number,
         default: 10000000000,
         min: 0
     },
     employees: [String],
     dateFounded: {
         type: Date,
         default: Date.now
     }
 });
}
@michaeljota
Copy link

You are using this.schema, and it's plain schema. Check if that fix it.

@kurdin
Copy link
Author

kurdin commented Feb 21, 2016

@michaeljota not sure what do you mean, can you explain please. What the right what to specify schema object without defining: this.name; this.valuation, this. employees .. etc?

@scottwrobinson
Copy link
Owner

@kurdin yep, you're right. Thanks for pointing this out!

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

No branches or pull requests

3 participants