meteor-astronomy icon indicating copy to clipboard operation
meteor-astronomy copied to clipboard

isModified is not a function

Open davidsavoie1 opened this issue 7 years ago • 5 comments

I'm sorry if it's obvious, but I can't find what's wrong here with my class named Service.

const servClass = new Service();
console.log('Created a new Service class instance.', servClass);
console.log('isModified', servClass.isModified());

If I execute this code, I get this error:

Uncaught TypeError: servClass.isModified is not a function

If I inspect my class object printed to the console, I do see in the class __proto__ some functions as raw, validate, set, etc. but I don't see functions such as isModified.

From my understanding of the documentation, I would have thought that all class instance objects would come with these functions... no?

What am I missing?

davidsavoie1 avatar Jul 14 '17 20:07 davidsavoie1

It's only true for classes that have collection attached to it, so that's why you don't see this method.

lukejagodzinski avatar Jul 15 '17 07:07 lukejagodzinski

Aaaahh! That explains a lot! Thanks for the info! Is it indicated somewhere in the docs? I haven't seent anything about it...

davidsavoie1 avatar Jul 17 '17 15:07 davidsavoie1

No, I think documentation doesn't mention it. It would be great if you could make a PR and add proper info.

lukejagodzinski avatar Jul 17 '17 18:07 lukejagodzinski

I've never done that before, I'll see what I can do to contribute!

davidsavoie1 avatar Jul 19 '17 12:07 davidsavoie1

I can help you with that :) it's not difficult. There is the gh-pages branch in which you have all the documentation. In this file you have a description of the isModified method. So you can just modify this file and create PR from the level of GitHub. Once, I accept this PR it will be automatically pushed to the docs.

lukejagodzinski avatar Jul 19 '17 20:07 lukejagodzinski