Skip to content

Commit

Permalink
Fixed $digest cycle detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Junaid Ilyas committed Feb 9, 2016
1 parent 894e29e commit 3a6f440
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dest/adaptive.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dest/adaptive.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ window.matchMedia || (window.matchMedia = function() {
if (mql.matches) {
element.html("<ng-include src=\"'" + templates[mql.media] + "'\"></ng-include>").show();
$compile(element.contents())(scope);
if (!scope.$$phase) {
if (!scope.$root.$$phase) {
scope.$digest();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/adaptive.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
element.html('<ng-include src="\'' + templates[mql.media] + '\'"></ng-include>').show();
$compile(element.contents())(scope);

if (!scope.$$phase) {
if (!scope.$root.$$phase) {
scope.$digest();
}
}
Expand Down

0 comments on commit 3a6f440

Please sign in to comment.