Skip to content

Commit 7d9db39

Browse files
committed
Fix deleting object form console won't auto-refresh the collection
1 parent 468a5b9 commit 7d9db39

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.docs/angular-meteor/client/views/steps/tutorial.step_03.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ <h1>Step 3 - 3-Way data binding</h1>
149149

150150
Again, you will see the UI of your app immediately update to without the removed party.
151151

152+
Try running more actions like update an object from the console and so on..
153+
152154
In the next step, we'll see how to add functionality to our app's UI so that we can add parties without using the database console.
153155

154156

modules/angular-meteor-meteorCollection.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,15 @@ AngularMeteorCollection.prototype.updateCursor = function (cursor) {
197197
safeApply();
198198
},
199199
removed: function (id) {
200-
var removedObject = _.findWhere(self, {_id: id});
200+
var removedObject;
201+
if (id._str){
202+
removedObject = _.find(self, function(obj) {
203+
return obj._id._str == id._str;
204+
});
205+
}
206+
else
207+
removedObject = _.findWhere(self, {_id: id});
208+
201209
if (removedObject){
202210
self.splice(self.indexOf(removedObject), 1);
203211
safeApply();

0 commit comments

Comments
 (0)