2014-10-02 93 views
1

我正在使用AngularJS和Sails進行項目工作。試圖運行Web應用程序,我發現了以下錯誤:使用AngularJS時出錯:「Diff is not defined」

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) 

我嘗試更新和使用最新版本的角度,並沒有什麼的。任何人都知道是什麼原因?

+1

看來,DIFF沒有定義。 – durbnpoisn 2014-10-02 19:17:27

回答

0

已解決,該函數位於庫的新版本中,位於「dist」目錄中。對不起,

功能:

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