-
Notifications
You must be signed in to change notification settings - Fork 67
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
Field assign in server side method notworking #686
Comments
Additional If I do it in this way
I see correct value of direction field |
You have to define fields in both environments client and server. It will not work when you only define them in one of them |
Sorry for confusing, I have common model that doesn't have any restrictions and another one that visible only on the server |
Ok, so what your doing wrong is using meteorMethods instead of helpers. For such cases where you only want to set values, you use helpers. Meteor methods would be used in cases where you just want to invoke something in the client and make sure that the same method is invoked on the server. |
So you mean that it is impossible to set any fields inside function that was defined inside Maybe it should be documented anywhere |
I said, |
I thought the whole point of the meteorMethods is to make sure the same code runs on both client and server at the same time? So surely if the same code is being run and is setting the same variables on both client and server, why can't you set any fields in methods? |
You can set fields values inside the method. If you have some reproduction repository a I can help solve your problem |
Hello.
Astronomy version: 2.5.2
I have client side and server side parts of my model.
in client side (common model without platform restrictions visible on both client and server) I define all fields:
on server side I define in most cases method:
Anywhere in server side code I do this
as result in console I see this output
When I move
setDirection
from methods to helpers all works perfect.Am I doing anything wrong, but looks like a bug?
The text was updated successfully, but these errors were encountered: