【问题标题】:Error using AngularJS: "Diff is not defined"使用 AngularJS 时出错:“未定义差异”
【发布时间】:2014-11-27 20:41:21
【问题描述】:

我正在开发一个使用 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,但什么也没有。谁知道是什么原因?

【问题讨论】:

  • 好像没有定义diff。

标签: angularjs node.js sails.js


【解决方案1】:

已解决,函数在新版库中,在“dist”目录下。对不起,

功能:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-11-03
    • 1970-01-01
    • 1970-01-01
    • 2020-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多