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

Question: bindOne .save()? #83

Closed
jakobloekke opened this issue Dec 7, 2014 · 3 comments
Closed

Question: bindOne .save()? #83

jakobloekke opened this issue Dec 7, 2014 · 3 comments

Comments

@jakobloekke
Copy link

What's the bindOne equivalent to .save()?

I have a bindOne set up for the logged in user – with 'auto' turned off:
$collection(Meteor.users).bindOne($scope, 'user', $rootScope.currentUser._id, false);

I don't want to auto update, but I can't figure out how to persist the data after editing.

@Urigo
Copy link
Owner

Urigo commented Dec 9, 2014

You should add also regular bind in your controller and call the save function with the current user.

$collection(Meteor.users).bindOne($scope, 'user', $rootScope.currentUser._id, false);
$collection(Meteor.users).bind($scope, 'users');

$scope.users.save($scope.user);

@jakobloekke
Copy link
Author

That seems to work. Thanks a lot. :)

@Urigo
Copy link
Owner

Urigo commented Dec 17, 2014

I've added an example also in the tutorial here:

http://angularjs.meteor.com/tutorial/step_06

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

2 participants