0
定義我有3個文件:
app.js
angular.module("starweb", ["ngRoute", "ngAnimate", "ui.bootstrap"])
.config(function ($routeProvider) {
$routeProvider ....
addHostingController.js
angular.module("starweb")
.controller("addHostingCtrl", function ($scope, domainService) {
$scope.data.domains = domainService.getDomain();
}
domainService.js
angular.module("starweb")
.constant("domainList", "http://localhost:15536/api/product/xxxx")
.service("domainService", function ($http, $q,domainList) {
return ({
getDomain: GetDomains()
});
});
function GetDomains() {
$http.get(domainList).then(handleSuccess, handleError);
}
在頁面源代碼中,包含所有3個文件(首先是app.js)。 Chrome顯示$http is undefined
,我的設置有什麼問題?
謝謝大家。
哦謝謝,我的壞。 – 2014-09-27 10:32:01