在离子应用程序中获取未捕获错误:[$ injector:modulerr]

时间:2015-08-03 17:27:54

标签: javascript angularjs ionic-framework angular-ui-router ionic

我试图调试我的离子应用程序但没有成功。我一直收到错误

Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module app.signin due to:
Error: [ng:areq] Argument 'fn' is not a function, got string
http://errors.angularjs.org/1.3.13/ng/areq?p0=fn&p1=not%20a%20function%2C%20got%20string

我确保我引用js文件的顺序没问题。我还确保我的角度版本在库中是一致的。 以下是我的index.html文件的片段

<body ng-app="app">
    <ion-nav-view></ion-nav-view>

    <script src="lib/ionic/js/ionic.bundle.js"></script>
    <script src="lib/lodash/lodash.min.js"></script>
    <script src="lib/restangular/dist/restangular.js"></script>
    <script src="lib/angular-local-storage/dist/angular-local-storage.js"></script>
    <script src="lib/angular-messages/angular-messages.js"></script>
    <script src="lib/ngCordova/dist/ng-cordova.js"></script>

    <!-- my app's js -->
    <script src="js/app.js"></script>
    <script src="js/core/core.js"></script>
    <script src="js/core/config/config.js"></script>
    <script src="js/core/services/authentication/authentication.service.js"></script>
    <script src="js/core/services/authentication/base64.service.js"></script>
    <script src="js/core/services/authentication/interceptor.service.js"></script>
    <script src="js/core/services/authentication/token.service.js"></script>
    <script src="js/core/services/error/error.service.js"></script>
    <script src="js/routes/layout/layout.js"></script>
    <script src="js/routes/layout/layout.route.js"></script>
    <script src="js/routes/layout/layout.controller.js"></script>
    <script src="js/routes/signin/signin.js"></script>
    <script src="js/routes/signin/signin.route.js"></script>
    <script src="js/routes/signin/signin.controller.js"></script>
    <script src="js/routes/signup/signup.js"></script>
    <script src="js/routes/signup/signup.route.js"></script>
    <script src="js/routes/signup/signup.controller.js"></script>

</body>

app.js代码段

(function () {
'use strict';

angular.module('app', [
    // angular modules
    'ngAnimate',
    'ngSanitize',
    'ngMessages',


    // 3rd party modules
    'ui.router',
    'ionic',
    'restangular',
    'LocalStorageModule',
    'ngCordova',

    // app modules
    'app.core',
    'app.layout',
    'app.signup',
    'app.signin'
]);

})();

0 个答案:

没有答案