无法实例化模块,AngularJS

时间:2014-11-21 10:10:08

标签: javascript angularjs module

我尝试使用angular-file-upload,https://github.com/danialfarid/angular-file-upload

当我尝试实例化angularFileModule模块时,我收到以下错误:

Error: [$injector:modulerr] Failed to instantiate module cryptlib due to: [$injector:modulerr] Failed to instantiate module angularFileUpload due to: [$injector:nomod] Module 'angularFileUpload' 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.

我正在尝试在app.js文件中实例化它:

var gameApp = angular.module("cryptlib", [
    'ngRoute',
    'ngSanitize',
    'cryptlib_controllers',
    'cryptlib_directives',
    'cryptlib_services',
    'angularFileUpload'
]);

angular.module('cryptlib_controllers', []);
angular.module('cryptlib_directives', []);
angular.module('cryptlib_services', []);

gameApp.config(function($routeProvider) {
    $routeProvider

    .when('/', {
            templateUrl : 'partials/firstpage.html',
            controller  : 'firstPageController'
    })

    .when('/game', {
            templateUrl : 'partials/uploadBook.html',
            controller  : 'uploadBookController'
    });

});

我不知道为什么这不起作用。任何人都可以帮助我吗?

0 个答案:

没有答案