Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ngAnimate causing an error

Error: f.element._data is not a function t@http://localhost:3000/lib/angular-animate/angular-animate.min.js:10 .enter/<@http://localhost:3000/lib/angular-animate/angular-animate.min.js:14 Ad/this.$get</h.prototype.$digest@http://localhost:3000/lib/angular/angular.min.js:101 Ad/this.$get</h.prototype.$apply@http://localhost:3000/lib/angular/angular.min.js:103 f@http://localhost:3000/lib/angular/angular.min.js:67 H@http://localhost:3000/lib/angular/angular.min.js:71 od/</C.onreadystatechange@http://localhost:3000/lib/angular/angular.min.js:72 

That's the error that I'm getting. I'm not doing anything other than including the angular-animate file: <script type="text/javascript" src="/lib/angular-animate/angular-animate.min.js"></script> and including it in my app:

angular.module('mean', ['ngCookies', 'ngResource', 'ngRoute', 'ngAnimate', 'ui.bootstrap', 'mean.system', 'mean.articles', 'mgcrea.ngStrap', 'pascalprecht.translate']);
like image 901
Shamoon Avatar asked Feb 26 '26 11:02

Shamoon


1 Answers

You are using angular-animate version 1.2.13 , but your angular.js version is older.


This commit is part of angular.js version 1.2.13:

chore(jqLite): expose the _data lookup function to angular.element

!!! This is an undocumented "private" function !!!

var jqData = JQLite._data = function(node) {
   //jQuery always returns an object on cache miss
   return this.cache[node[this.expando]] || {};
 };

Angular-animate: the line that uses the new 1.2.13 API

var elementEvents = angular.element._data(node);

Always make sure your angular.js version is IN SYNC with all angular modules.

like image 71
Ilan Frumer Avatar answered Feb 28 '26 00:02

Ilan Frumer