aboutsummaryrefslogtreecommitdiffstats
path: root/src/widgets.js
diff options
context:
space:
mode:
authorMisko Hevery2010-04-30 12:22:07 -0700
committerMisko Hevery2010-04-30 12:22:07 -0700
commitac1d02d0658cb74ae3822e364f84809d78cda335 (patch)
tree6c5fdbd670d758d65c4d52f2e261818ac1607f47 /src/widgets.js
parent549ff73a9b66e718383c79ccd7c28e4f9b25632d (diff)
downloadangular.js-ac1d02d0658cb74ae3822e364f84809d78cda335.tar.bz2
make xhr post optional
Diffstat (limited to 'src/widgets.js')
-rw-r--r--src/widgets.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/widgets.js b/src/widgets.js
index 8a816934..2fade3e3 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -192,22 +192,21 @@ angularWidget('NG:INCLUDE', function(element){
function incrementChange(){ changeCounter++;}
this.$watch(srcExp, incrementChange);
this.$watch(scopeExp, incrementChange);
+ scope.$onEval(function(){
+ if (childScope) childScope.$eval();
+ });
this.$watch(function(){return changeCounter;}, function(){
var src = this.$eval(srcExp),
useScope = this.$eval(scopeExp);
if (src) {
- scope.$browser.xhr('GET', src, function(code, response){
+ scope.$xhr.cache('GET', src, function(code, response){
element.html(response);
childScope = useScope || createScope(scope);
compiler.compile(element)(element, childScope);
childScope.$init();
- scope.$root.$eval();
});
}
});
- scope.$onEval(function(){
- if (childScope) childScope.$eval();
- });
};
}
});