使用AngularJS时出错:“未定义Diff”

时间:2014-10-02 19:15:36

标签: angularjs node.js sails.js

我正在使用AngularJS和Sails开展项目。试图运行webapp,我发现以下错误:

 ReferenceError: diff is not defined
 at http://localhost:1337/js/angular-sails-bind.js:108:38
 at Object.fn (http://localhost:1337/js/dependencies/angular.min.js:117:478)
 at k.$digest (http://localhost:1337/js/dependencies/angular.min.js:119:35)
 at k.$apply (http://localhost:1337/js/dependencies/angular.min.js:121:460)
 at http://localhost:1337/js/angular-sails-bind.js:180:28
 at c.serverResponded (http://localhost:1337/js/dependencies/sails.io.js:362:11)
 at c.onPacket (http://localhost:1337/js/dependencies/sails.io.js:2:20375)
 at d.onPacket (http://localhost:1337/js/dependencies/sails.io.js:2:16703)
 at c.onPacket (http://localhost:1337/js/dependencies/sails.io.js:2:10676)
 at c.onData (http://localhost:1337/js/dependencies/sails.io.js:2:10413)

我尝试更新并使用最新版本的Angle,什么都没有。有谁知道是什么原因?

1 个答案:

答案 0 :(得分:0)

解决了,该函数在新版本的库中,位于“dist”目录中。对不起,

功能:

function diff(arr1, arr2) {
return arr1.filter(function (i) {
    return arr2.indexOf(i) < 0;
});
}