aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/services.js2
-rw-r--r--src/widgets.js11
2 files changed, 12 insertions, 1 deletions
diff --git a/src/services.js b/src/services.js
index de65e30f..1a7b91ac 100644
--- a/src/services.js
+++ b/src/services.js
@@ -708,7 +708,7 @@ angularServiceInject('$route', function(location) {
if (!childScope) {
var pathParams = matcher(location.hashPath, route);
if (pathParams) {
- childScope = parentScope.$new();
+ childScope = createScope(parentScope);
$route.current = extend({}, routeParams, {
scope: childScope,
params: extend({}, location.hashSearch, pathParams)
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);