From 129e2e021ab1d773874428cd1fb329eae72797c4 Mon Sep 17 00:00:00 2001 From: Tomer Chachamu Date: Tue, 4 Mar 2014 15:29:11 +0000 Subject: fix(ngAnimate): setting classNameFilter disables animation inside ng-if Closes #6539 --- test/ngAnimate/animateSpec.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'test') diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index fb9ba19e..204ca9c3 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -3356,6 +3356,49 @@ describe("ngAnimate", function() { }); }); + it('should animate only the specified CSS className inside ng-if', function() { + var captures = {}; + module(function($animateProvider) { + $animateProvider.classNameFilter(/prefixed-animation/); + $animateProvider.register('.capture', function() { + return { + enter : buildFn('enter'), + leave : buildFn('leave') + }; + + function buildFn(key) { + return function(element, className, done) { + captures[key] = true; + (done || className)(); + } + } + }); + }); + inject(function($rootScope, $compile, $rootElement, $document, $sniffer, $animate) { + if(!$sniffer.transitions) return; + + var upperElement = $compile('