angular-meteor
angular-meteor copied to clipboard
Question: bindOne .save()?
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.
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);
That seems to work. Thanks a lot. :)
I've added an example also in the tutorial here:
http://angularjs.meteor.com/tutorial/step_06