From ac1d02d0658cb74ae3822e364f84809d78cda335 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 30 Apr 2010 12:22:07 -0700 Subject: make xhr post optional --- src/widgets.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/widgets.js') 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(); - }); }; } }); -- cgit v1.2.3