Skip to content

Commit 60d2072

Browse files
committed
fix phase check in isolated scopes
1 parent 0da0569 commit 60d2072

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/angular-meteor-collections.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ angularMeteorCollections.factory('$collection', ['$q', 'HashKeyCopier', '$subscr
1313
bindOne: function(scope, model, id, auto, publisher) {
1414
Tracker.autorun(function(self) {
1515
scope[model] = collection.findOne(id);
16-
if (!scope.$$phase) scope.$apply(); // Update bindings in scope.
16+
if (!scope.$root.$$phase) scope.$apply(); // Update bindings in scope.
1717
scope.$on('$destroy', function () {
1818
self.stop(); // Stop computation if scope is destroyed.
1919
});
@@ -72,7 +72,7 @@ angularMeteorCollections.factory('$collection', ['$q', 'HashKeyCopier', '$subscr
7272
var newArray = HashKeyCopier.copyHashKeys(scope[model], ngCollection, ["_id"]);
7373
scope[model] = updateAngularCollection(newArray, scope[model]);
7474

75-
if (!scope.$$phase) scope.$apply(); // Update bindings in scope.
75+
if (!scope.$root.$$phase) scope.$apply(); // Update bindings in scope.
7676
scope.$on('$destroy', function () {
7777
self.stop(); // Stop computation if scope is destroyed.
7878
});

0 commit comments

Comments
 (0)