I have 3 files:
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);
}
On the page source, all 3 files are included (app.js first). Chrome shows $http is undefined, what's wrong with my setup ?
Thanks all.