I am trying to build a very, very simple service and use it in angular, with all of my code listed below. But no matter what I try, I'm getting told ...
Unknown provider: userServiceProvider <- userService
I'm pulling my hair out with this, so I'm hoping experienced eyes can see what I'm missing..
app.js
(function () {
angular.module('Application', [
'kendo.directives',
'ui.bootstrap',
'ui.bootstrap.drawer',
'ui.check',
]);
})();
identity.js
(function () {
'use strict';
var UserService = function ($http) {
this.Find = function () {
return this.$http.get("/member/identity").then(function (response) {
return response.data;
});
}
}
angular
.module('Application')
.service('UserService', [UserService,"$http"]);
})();
controller.js
(function () {
'use strict';
var UserController = function (userService, $scope) {
var _this = $scope;
userService.Find().then(function (user) {
_this.User = user;
});
};
angular
.module('Application')
.controller('UserController',
UserController, ['Application.UserService', "$scope"]
);
})();