2014-02-16 75 views
3
Error: f.element._data is not a function [email protected]://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</[email protected]://localhost:3000/lib/angular/angular.min.js:101 Ad/this.$get</[email protected]://localhost:3000/lib/angular/angular.min.js:103 [email protected]://localhost:3000/lib/angular/angular.min.js:67 [email protected]://localhost:3000/lib/angular/angular.min.js:71 od/</[email protected]://localhost:3000/lib/angular/angular.min.js:72 

这就是我得到的错误。我没有做任何其他比包括角动画文件:<script type="text/javascript" src="/lib/angular-animate/angular-animate.min.js"></script>和包括它在我的应用程序:ng动画导致错误

angular.module('mean', ['ngCookies', 'ngResource', 'ngRoute', 'ngAnimate', 'ui.bootstrap', 'mean.system', 'mean.articles', 'mgcrea.ngStrap', 'pascalprecht.translate']); 

回答

3

您正在使用角动画版1.2.13,但你的angular.js版本老。


This commit是angular.js版本1.2.13部分:

家务(jqLit​​e):暴露_data查找功能来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]] || {}; 
}; 

角动画:the line that uses the new 1.2.13 API

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

务必确保您的angular.js版本同步所有角模块。