Skip to content

Commit

Permalink
Merge pull request #3 from 2i/master
Browse files Browse the repository at this point in the history
Fix for issue #2
  • Loading branch information
stakach committed Mar 3, 2016
2 parents e4cfeb5 + 240e8de commit 105c26b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion safe-apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@

fn = fn || function () {};

if (force || !($scope.$$phase || $scope.$root.$$phase)) {
if (force || !($scope.$$phase ||
($scope.$root && $scope.$root.$$phase))) {
$scope.$apply ? $scope.$apply(fn) : $scope.apply(fn);
} else {
fn();
Expand Down

0 comments on commit 105c26b

Please sign in to comment.