aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/widgets.js b/src/widgets.js
index 877f4a72..34cc258a 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -256,11 +256,19 @@ angularWidget('ng:include', function(element){
return extend(function(xhr, element){
var scope = this, childScope;
var changeCounter = 0;
+ var preventRecursion = false;
function incrementChange(){ changeCounter++;}
this.$watch(srcExp, incrementChange);
this.$watch(scopeExp, incrementChange);
scope.$onEval(function(){
- if (childScope) childScope.$eval();
+ if (childScope && !preventRecursion) {
+ preventRecursion = true;
+ try {
+ childScope.$eval();
+ } finally {
+ preventRecursion = false;
+ }
+ }
});
this.$watch(function(){return changeCounter;}, function(){
var src = this.$eval(srcExp),