これは私が
Index.htmlと //参考に$をhttpでエラーを取得する必要があり、問題
である理由わかりませんファイル
<script src="common/services/common.services.js"></script>
<script src="common/services/deviceService.js"></script>
common.services.jsは//私は明らかに$ HTTPをためngResource/$リソースを使用していないよ、私はhttpproviderを使用する必要がありますか?問題はここにある
(function() {
"use strict";
angular
.module("common.services", // name of module
["ngResource"]) // array that defines the dependencies (ngResource contains the $resource service)
}());
...
deviceService.js
(function() {
"use strict";
angular
.module("common.services")
.factory("deviceService",
["$http",deviceService]);
function deviceService($http) {
function httpGetCost(cost, amount, $http) {
$http.get('../api/deviceEvents.json')
.then(function (result) {
//.......
}
return { outsideCall: httpGetCost }
}
}());
- 私は本当にcommon.service.jsの確認を目的... ないんだけど
- httpproviderサービス参照を取得するには$ httpが必要ですか?
- 私は$ httpに正しく挿入されていません?
$ httpを内部関数httpGetcost()に渡すべきではないと思います。それを試してみることができますか? – SanketR