From 6f15a75d7d9ac865acfe1e746214f0cd0dd78411 Mon Sep 17 00:00:00 2001 From: Ryan Johnston Date: Thu, 11 Apr 2013 18:37:28 +1200 Subject: [PATCH] AngularJS v1.1.4 support for ng-animate directive. --- src/viewDirective.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/viewDirective.js b/src/viewDirective.js index f936ef7af..e5cd98ae5 100644 --- a/src/viewDirective.js +++ b/src/viewDirective.js @@ -1,13 +1,14 @@ -$ViewDirective.$inject = ['$state', '$compile', '$controller', '$anchorScroll']; -function $ViewDirective( $state, $compile, $controller, $anchorScroll) { +$ViewDirective.$inject = ['$state', '$compile', '$controller', '$anchorScroll', '$animator']; +function $ViewDirective( $state, $compile, $controller, $anchorScroll, $animator) { var directive = { restrict: 'ECA', terminal: true, link: function(scope, element, attr) { var viewScope, viewLocals, name = attr[directive.name] || attr.name || '', - onloadExp = attr.onload || ''; + onloadExp = attr.onload || '', + animate = $animator(scope, attr); // Find the details of the parent view directive (if any) and use it // to derive our own qualified view name, then hang our own details @@ -34,7 +35,8 @@ function $ViewDirective( $state, $compile, $controller, $anchorScroll) { viewLocals = locals; view.state = locals.$$state; - element.html(locals.$template); + animate.leave(element.contents(), element); + animate.enter(angular.element('
').html(locals.$template).contents(), element); // element.html('
' + name + '
' + locals.$template); var link = $compile(element.contents()); viewScope = scope.$new();