diff options
| author | Igor Minar | 2011-01-23 22:24:53 -0800 | 
|---|---|---|
| committer | Igor Minar | 2011-01-24 14:03:42 -0800 | 
| commit | 8d507df8c9664cc35467577971532cc20be2912f (patch) | |
| tree | 24fd2fd811956386da2b166325f639dfc83fb96c /src/widgets.js | |
| parent | 567f33823b34969fa1b340c9d6c04e2c5a60d281 (diff) | |
| download | angular.js-8d507df8c9664cc35467577971532cc20be2912f.tar.bz2 | |
Revert "$route should create child scope via $new"
This reverts commit a5eb3ed107034cce5b7de3ec3f8a43ff3a379fa1.
See 9ca2facb for reasoning.
Diffstat (limited to 'src/widgets.js')
| -rw-r--r-- | src/widgets.js | 11 | 
1 files changed, 11 insertions, 0 deletions
| diff --git a/src/widgets.js b/src/widgets.js index 4585629a..c131b646 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -625,9 +625,20 @@ 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 && !preventRecursion) { +          preventRecursion = true; +          try { +            childScope.$eval(); +          } finally { +            preventRecursion = false; +          } +        } +      });        this.$watch(function(){return changeCounter;}, function(){          var src = this.$eval(srcExp),              useScope = this.$eval(scopeExp); | 
