From 6e8bd786ba853613472f3864e48048a425c46823 Mon Sep 17 00:00:00 2001 From: Matias Niemelàˆ Date: Thu, 1 Aug 2013 22:17:10 -0400 Subject: fix(ngAnimate): remove compound JS selector animations --- src/ng/animate.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/ng') diff --git a/src/ng/animate.js b/src/ng/animate.js index 7927b12f..2d9e6191 100644 --- a/src/ng/animate.js +++ b/src/ng/animate.js @@ -1,5 +1,7 @@ 'use strict'; +var $animateMinErr = minErr('$animate'); + /** * @ngdoc object * @name ng.$animateProvider @@ -14,7 +16,7 @@ */ var $AnimateProvider = ['$provide', function($provide) { - this.$$selectors = []; + this.$$selectors = {}; /** @@ -47,13 +49,11 @@ var $AnimateProvider = ['$provide', function($provide) { * @param {function} factory The factory function that will be executed to return the animation object. */ this.register = function(name, factory) { - var classes = name.substr(1).split('.'); - name += '-animation'; - this.$$selectors.push({ - selectors : classes, - name : name - }); - $provide.factory(name, factory); + var key = name + '-animation'; + if (name && name.charAt(0) != '.') throw $animateMinErr('notcsel', + "Expecting class selector starting with '.' got '{0}'.", name); + this.$$selectors[name.substr(1)] = key; + $provide.factory(key, factory); }; this.$get = ['$timeout', function($timeout) { -- cgit v1.2.3