From 958d3d56b1899a2cfc7b18c0292e5a1d8c64d0a5 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Wed, 4 Dec 2013 12:49:02 -0500 Subject: fix($animate): ensure animations work with directives that share a transclusion Closes #4716 Closes #4871 Closes #5021 Closes #5278 --- test/ngAnimate/animateSpec.js | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'test/ngAnimate') diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index b3068470..44b623b4 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -2873,5 +2873,58 @@ describe("ngAnimate", function() { expect($rootElement.children().length).toBe(0); })); + + it('should properly animate elements with compound directives', function() { + var capturedAnimation; + module(function($animateProvider) { + $animateProvider.register('.special', function() { + return { + enter : function(element, done) { + capturedAnimation = 'enter'; + done(); + }, + leave : function(element, done) { + capturedAnimation = 'leave'; + done(); + } + } + }); + }); + inject(function($rootScope, $compile, $rootElement, $document, $timeout, $templateCache, $sniffer) { + if(!$sniffer.transitions) return; + + $templateCache.put('item-template', 'item: #{{ item }} '); + var element = $compile('