I am new to angular and I was trying to implement a custom service. Code is below:
app.js
angular.module('hrg', [
'ui.router',
'ui.bootstrap',
'ngTouch',
'ngAnimate',
'ngCookies',
'hrg.home'
])
.service('userService', ['', function(){
//data
}])
home.js
angular.module('hrg.home', ['ui.router'])
.controller('HomeController', ['$scope','$http','$cookies','$state','consts', 'userService',
function($scope, $http, $cookies, $state, consts, userService) {
//data
}])
index.html
<script src="app.js"></script>
<script src="components/home/home.js"></script>
The error is: [$injector:unpr] http://errors.angularjs.org/1.5.0/$injector/unpr?p0=userServiceProvider%20%3C-%20userService%20%3C-%20HomeController
What is it that I am doing wrong?