This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ var $$CoreAnimateQueueProvider = function() {
163
163
var $AnimateProvider = [ '$provide' , function ( $provide ) {
164
164
var provider = this ;
165
165
166
- this . $$registeredAnimations = [ ] ;
166
+ this . $$registeredAnimations = Object . create ( null ) ;
167
167
168
168
/**
169
169
* @ngdoc method
Original file line number Diff line number Diff line change @@ -115,6 +115,21 @@ describe("$animate", function() {
115
115
inject ( ) ;
116
116
} ) ;
117
117
118
+ it ( "should register the animation and be available for lookup" , function ( ) {
119
+ var provider ;
120
+ module ( function ( $animateProvider ) {
121
+ provider = $animateProvider ;
122
+ } ) ;
123
+ inject ( function ( ) {
124
+ // by using hasOwnProperty we know for sure that the lookup object is an empty object
125
+ // instead of inhertiting properties from its original prototype.
126
+ expect ( provider . $$registeredAnimations . hasOwnProperty ) . toBeFalsy ( ) ;
127
+
128
+ provider . register ( '.filter' , noop ) ;
129
+ expect ( provider . $$registeredAnimations [ 'filter' ] ) . toBe ( '.filter-animation' ) ;
130
+ } ) ;
131
+ } ) ;
132
+
118
133
it ( "should apply and retain inline styles on the element that is animated" , inject ( function ( $animate , $rootScope ) {
119
134
var element = jqLite ( '<div></div>' ) ;
120
135
var parent = jqLite ( '<div></div>' ) ;
You can’t perform that action at this time.
0 commit comments