无法集成第三方角度模块

时间:2015-09-24 14:19:00

标签: javascript angularjs

我正在尝试集成以下角度模块:

https://github.com/wongatech/angular-http-loader/blob/master/app/src/demo.html

进入我的应用

然而,当我尝试整合它时,我会看到一个白色的屏幕。

我的代码如下:

/* global app:true */
/* exported app */
'use strict';

/**
 * @ngdoc overview
 * @name WebAppApp
 * @description
 * # WebAppApp
 *
 * Main module of the application.
 */
var app = angular
    .module('WebAppApp', [
        'ngAnimate',
        'ngAria',
        'ngCookies',
        'ngMessages',
        'ngResource',
        'ngRoute',
        'ngSanitize',
        'ngTouch',
        'angularUtils.directives.dirPagination',
        'ui.bootstrap',
        'ng.httpLoader'
    ])
    .config(function($routeProvider, $locationProvider) {
        $routeProvider
            .when('/', {
                templateUrl: 'views/login.html',
                controller: 'loginCtrl',
                //  controllerAs: 'login'
            })
            .when('/home', {
                controller: 'homeCtrl',
                templateUrl: 'views/home.html',
                resolve: {
                    "checkLoggedIn": function($location, $cookies, $rootScope) {
                        if (!$cookies.get('globals')) {
                            $location.path('/');
                        }
                    }
                },
                //controllerAs: 'home'
            })
            .when('/menteeMentors', {
                controller: 'menteeMentorsCtrl',
                templateUrl: 'views/listMentorsMentees.html',
                resolve: {
                    "checkLoggedIn": function($location, $cookies, $rootScope) {
                        if (!$cookies.get('globals')) {
                            $location.path('/');
                        }
                    }
                },
                //controllerAs: 'home'
            })
            .when('/myGoals', {
                controller: 'myGoalsCtrl',
                templateUrl: 'views/myGoals.html',
                resolve: {
                    "checkLoggedIn": function($location, $cookies, $rootScope) {
                        if (!$cookies.get('globals')) {
                            $location.path('/');
                        }
                    }
                },
                //controllerAs: 'home'
            })
            .when('/addGoal', {
                controller: 'myGoalsCtrl',
                templateUrl: 'views/addGoal.html',
                resolve: {
                    "checkLoggedIn": function($location, $cookies, $rootScope) {
                        if (!$cookies.get('globals')) {
                            $location.path('/');
                        }
                    }
                },
                //controllerAs: 'home'
            })
            .when('/signup', {
                templateUrl: 'views/signup.html',
                controller: 'signupCtrl',
                //controllerAs: 'home'
            })
            .otherwise({
                redirectTo: '/'
            });

        //check browser support
        if (window.history && window.history.pushState) {
            //$locationProvider.html5Mode(true); will cause an error $location in HTML5 mode requires a  tag to be present! Unless you set baseUrl tag after head tag like so: <head> <base href="/">

            // to know more about setting base URL visit: https://docs.angularjs.org/error/$location/nobase

            // if you don't wish to set base URL then use this
            $locationProvider.html5Mode({
                enabled: true,
                requireBase: false
            });
        }

    });

.config([
    'httpMethodInterceptorProvider',
    function(httpMethodInterceptorProvider) {
        httpMethodInterceptorProvider.whitelistDomain('validate.jsontest.com');
        httpMethodInterceptorProvider.whitelistDomain('github.com');
    }
]);

我正在为AngularJS使用yeoman脚手架

来自控制台的错误是:

Uncaught Error: [$injector:modulerr] Failed to instantiate module WebAppApp due to:
Error: [$injector:nomod] Module 'WebAppApp' 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.
http://errors.angularjs.org/1.4.3/$injector/nomod?p0=WebAppApp
    at REGEX_STRING_REGEXP (http://localhost:9000/bower_components/angular/angular.js:68:12)
    at http://localhost:9000/bower_components/angular/angular.js:1958:17
    at ensure (http://localhost:9000/bower_components/angular/angular.js:1882:38)
    at module (http://localhost:9000/bower_components/angular/angular.js:1956:14)
    at http://localhost:9000/bower_components/angular/angular.js:4362:22
    at forEach (http://localhost:9000/bower_components/angular/angular.js:336:20)
    at loadModules (http://localhost:9000/bower_components/angular/angular.js:4346:5)
    at createInjector (http://localhost:9000/bower_components/angular/angular.js:4272:11)
    at doBootstrap (http://localhost:9000/bower_components/angular/angular.js:1630:20)
    at bootstrap (http://localhost:9000/bower_components/angular/angular.js:1651:12)
http://errors.angularjs.org/1.4.3/$injector/modulerr?p0=urbaneWebAppApp&p1=…F%2Flocalhost%3A9000%2Fbower_components%2Fangular%2Fangular.js%3A1651%3A12)

0 个答案:

没有答案