aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/ngInclude.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ng/directive/ngInclude.js')
-rw-r--r--src/ng/directive/ngInclude.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ng/directive/ngInclude.js b/src/ng/directive/ngInclude.js
index f4b84fcf..7ca9a48b 100644
--- a/src/ng/directive/ngInclude.js
+++ b/src/ng/directive/ngInclude.js
@@ -176,6 +176,11 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
};
scope.$watch($sce.parseAsResourceUrl(srcExp), function ngIncludeWatchAction(src) {
+ var afterAnimation = function() {
+ if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
+ $anchorScroll();
+ }
+ };
var thisChangeId = ++changeCounter;
if (src) {
@@ -190,13 +195,8 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
currentElement = clone;
currentElement.html(response);
- $animate.enter(currentElement, null, $element);
+ $animate.enter(currentElement, null, $element, afterAnimation);
$compile(currentElement.contents())(currentScope);
-
- if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
- $anchorScroll();
- }
-
currentScope.$emit('$includeContentLoaded');
scope.$eval(onloadExp);
});