AngularJS未能实例化模块

AngularJS未能实例化模块,angularjs,angularjs-service,angularjs-module,Angularjs,Angularjs Service,Angularjs Module,我是AngularJS的新手,我试图创建一个身份验证服务,但我遇到了这个错误 Error: [$injector:modulerr] Failed to instantiate module flujoDeCaja due to: [$injector:modulerr] Failed to instantiate module auth due to: [$injector:nomod] Module 'auth' is not available! You either misspelled

我是AngularJS的新手,我试图创建一个身份验证服务,但我遇到了这个错误

Error: [$injector:modulerr] Failed to instantiate module flujoDeCaja due to:
[$injector:modulerr] Failed to instantiate module auth due to:
[$injector:nomod] Module 'auth' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
这是我的密码:

Service.js

'use strict';

var mod = angular.module('auth',['restangular']);

mod.service('AuthService', ['', function(){

    var userIsAuthenticated = false;

    this.setUserAuthenticated = function(value){
        userIsAuthenticated = value;
    };

    this.getUserAuthenticated = function(){
        return userIsAuthenticated;
    });

}]);
var angularModule = angular.module('flujoDeCaja', [
  'ngCookies',
  'ngResource',
  'ngSanitize',
  'ngRoute',
  'restangular',
  'auth'
]);
App.js

'use strict';

var mod = angular.module('auth',['restangular']);

mod.service('AuthService', ['', function(){

    var userIsAuthenticated = false;

    this.setUserAuthenticated = function(value){
        userIsAuthenticated = value;
    };

    this.getUserAuthenticated = function(){
        return userIsAuthenticated;
    });

}]);
var angularModule = angular.module('flujoDeCaja', [
  'ngCookies',
  'ngResource',
  'ngSanitize',
  'ngRoute',
  'restangular',
  'auth'
]);
Index.html

<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/restangular/dist/restangular.js"></script>
<script src="scripts/services/services.js"></script>
<script src="scripts/app.js"></script>

我做错了什么


提前谢谢:)

纠正了我认为错误的地方

mod.service('AuthService', [function(){

    var userIsAuthenticated = false;

    this.setUserAuthenticated = function(value){
        userIsAuthenticated = value;
    };

    this.getUserAuthenticated = function(){
        return userIsAuthenticated;
    };

}]);

如果没有服务定义,则不需要依赖项的空白字符串谢谢,你是对的。我的另一个错误是,')在getUserAuthenticated函数的'}'之后,感谢反馈,更新了我的答案,以反映修复所有问题所需的更改