我新的角度,我試圖構建我的應用程序下面https://github.com/angular-app/angular-appAngularJS:工廠和控制器
的問題是,當我確定我廠與控制器... app.service
angular.module("app.service", [])
.factory('currencyService', function ($http, $q) {
var getCurrency = function() {
var deferred = $q.defer();
$http({
url: baseUrl + "currency/GetAll/",
method: "GET"
}).success(function (data) {
deferred.resolve(data);
}).error(function (data, status, headers, config) {
});
return deferred.promise;
}
});
controller :
angular.module('vendor.controller.edit',
[
"acute.select",
"ui.bootstrap",
"ngRoute",
"app.service"
])
.controller('vendorEditCtrl', ["$scope", "$routeParams", "$http", "$modal","currencyService", function ($scope, $routeParams, $http, $modal, currencyService) {
...
}
問題是控制器內部currencyService
未定義... 有什麼想法爲什麼?
感謝任何人可以幫助!
你不回來從你的工廠什麼? – CallumVass