Urigo / meteor-angular-socially

angular-meteor example and tutorial app
https://www.angular-meteor.com/tutorials/socially/angular1/bootstrapping
155 stars 144 forks source link

Changes are overwritten when document updated elsewhere #153

Closed turbobuilt closed 7 years ago

turbobuilt commented 7 years ago

Hello,

I'm still using the old angularMeteorObject in my code because of it's auto-diffing for save. I'm having an issue with it overwriting my usaved changes when an object is updated elsewhere

$scope.item = $scope.$meteorObject(collection, options.id, false);

Sometimes in my application I want to "touch" the item, simply modifying it's "updatedAt" date. Sometimes I do this before saving the current object. Unfortunately, if I change the updatedAt date, the change is published and angularMeteor discards all my working changes, and puts in the old copy with the new updatedAt time. Is there a way I can make meteorObject ignore updates from the subscription that conflict with unsaved data?

turbobuilt commented 7 years ago

Sorry I meant to post this in the angular-meteor repo.

I figured it out though! Just call $scope.item.stop()