以下に定義されている angularjs 用の 2 つの異なるアプリケーション ファイルがあります。
search.js
var app = angular.module('search',['ngGrid']);
app.factory('answers',function($http){
return{
search: function(params,success,error){
//code to execute over rest
},
otherSearch: function(params,success,error){
//code to execute over rest
}
};
});
results.js
var app = angular.module('results',['ui.bootstrap','ngGrid']);
app.controller('resultsCtrl',function($scope,$http,search) // search should reference search.js
search.search();
search.otherSearch();
});
私がやろうとしているのは、 from内のsearch
andotherSearch
関数を参照することですが、これを行うと不明なプロバイダーで失敗します: search.js
results.js
var app = angular.module('results',['ui.bootstrap','ngGrid','search']);
FACTORY
含まれているメソッドを呼び出すことができるようにする正しい方法は何ですかsearch.js