@@ -219,8 +219,10 @@ angularMeteorCollections.factory('AngularMeteorCollection', ['$q', '$meteorSubsc
219
219
} ;
220
220
221
221
AngularMeteorCollection . stop = function ( ) {
222
- if ( this . unregisterAutoBind )
222
+ if ( this . unregisterAutoBind ) {
223
+ this . _isAutoBind = false ;
223
224
this . unregisterAutoBind ( ) ;
225
+ }
224
226
225
227
if ( this . observeHandle )
226
228
this . observeHandle . stop ( ) ;
@@ -282,17 +284,21 @@ angularMeteorCollections.factory('$meteorCollection', ['AngularMeteorCollection'
282
284
283
285
function setAutoBind ( ) {
284
286
if ( auto ) { // Deep watches the model and performs autobind.
287
+ ngCollection . _isAutoBind = true ;
285
288
ngCollection . unregisterAutoBind = $rootScope . $watch ( function ( ) {
286
289
if ( ngCollection . UPDATING_FROM_SERVER ) {
287
290
return 'UPDATING_FROM_SERVER' ;
288
291
}
289
292
return angular . copy ( _ . without ( ngCollection , 'UPDATING_FROM_SERVER' ) ) ;
290
293
} , function ( newItems , oldItems ) {
294
+ if ( ngCollection . _isAutoBind == false )
295
+ return ;
291
296
if ( newItems === 'UPDATING_FROM_SERVER' ||
292
297
oldItems === 'UPDATING_FROM_SERVER' )
293
298
return ;
294
299
295
300
if ( newItems !== oldItems ) {
301
+ ngCollection . _isAutoBind = false ;
296
302
ngCollection . unregisterAutoBind ( ) ;
297
303
298
304
updateCollection ( ngCollection , oldItems , diffArrayFunc ) ;
0 commit comments