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

Callback issues with MeteorComponent "autoBind" #323

Closed
Richie765 opened this issue Jul 8, 2016 · 4 comments
Closed

Callback issues with MeteorComponent "autoBind" #323

Richie765 opened this issue Jul 8, 2016 · 4 comments

Comments

@Richie765
Copy link

First of all, could the autoBind parameter be documented better? I know it will bind to the NgZone, but what does that mean exactly? I thought it had to do with getting a better stack trace with errors, but I don't see that. I only notice sometimes I need to bind the subscription or otherwise I won't see the results immediately in my template.

MeteorComponent.call. When autoBind is true, the callback is called in a wrong way. Normally the callback is function(err, res), but when autoBind is true, the callback is called like function([err,res]), e.g. both parameters are passed inside an array. I think the autoBind parameter is superfluous, because if you don't want to bind you can just as well call Meteor.call. Perhaps that could at least be documented.

MeteorComponent.subscribe. When autoBind is true, and the resultCallback is an object, it seems all fields: onReady, onStop and onError are required. All of them should be optional. IIRC both onStop and onError incorrectly receive the error inside an array in the first parameter.

MeteorComponent.autorun. Haven't used this one yet, but looking at the docs and the source code it seems there is no way to specify the onError option, like the one of Tracker.autorun.

Hope this can be solved. Starting to like Meteor with Angular 2 :-)

@barbatus
Copy link
Collaborator

barbatus commented Jul 8, 2016

Which version of the angular2-meteor are using?
autoBind now is true by default.

@Richie765
Copy link
Author

I'm at 0.5.5, I thought that was the latest. I can't update right now since I got some RC.1 dependencies. Not sure how much has been fixed already.

@Urigo
Copy link
Owner

Urigo commented Jul 9, 2016

in terms of angular2-meteor, we support and tested with the latest RC.4 so we shouldn't hold you back from updating

@Urigo
Copy link
Owner

Urigo commented Jul 20, 2016

released in 0.6.2

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