angular bootstrap 灯箱抛出未知提供商错误

angular bootstrap lightbox throws unknown provider error

我是 AngularJS 的新手,正在尝试学习一些东西。我正在尝试使用 angular-bootstrap-lightbox 创建一个画廊,并且我已经包含了该项目所需的所有必要依赖项。包括的依赖项是:

<link href="css/angular-bootstrap-lightbox.min.css" rel="stylesheet" />
<script src="js/angular.js"></script>
<script src="js/angular-route.min.js"></script>
<script src="js/ui-bootstrap-tpls-1.3.2.min.js"></script>
<script src="js/angular-bootstrap-lightbox.min.js"></script>
<script src="js/script.js"></script>

下面是我的script.js文件

angular.module('home', ["ngRoute", "bootstrapLightbox"]).
    config(function ($routeProvider, $locationProvider) {
        $routeProvider.
            when('/home', { templateUrl: 'partials/home.html' }).
            when('/about', { templateUrl: 'partials/about.html' }).
            when('/gallery', { templateUrl: 'partials/gallery.html', controller: "galleryController" }).
            otherwise({ redirectTo: '/home', templateUrl: 'partials/home.html' });
        $locationProvider.html5Mode(true);
    }).controller("homeController", function ($scope, $http, $route) {
        //home controller stuffs
    }).controller('indexController', function ($scope, $location) {
        $scope.isActive = function (route) {
            return route === $location.path();
        }
    }).controller('galleryController', function ($scope, LightBox) {
        $scope.images = [
        {
            'url': 'images/g1.jpg',
            'caption': 'Optional caption',
            'thumbUrl': 'images/g1.jpg' // used only for this example
        },
        {
            'url': 'images/g1.jpg',
            'thumbUrl': 'images/g1.jpg'
        },
        {
            'url': 'images/g1.jpg',
            'thumbUrl': 'images/g1.jpg'
        }
        ];

        $scope.openLightboxModal = function (index) {
            Lightbox.openModal($scope.images, index);
        };
    });

但每当我访问图库页面时,它总是抛出 未知提供程序错误,并且此错误将指向 Lightbox 中提到的参数以及 $scope =19=]。不确定这里的依赖项是什么。但是它不识别LightBox。我已经按照那里提到的完整步骤进行操作,但无法完全实现这一目标。任何帮助表示赞赏。

更新

下面是我得到的错误。

angular.js:13424 Error: [$injector:unpr] Unknown provider: LightBoxProvider <- LightBox <- galleryController
http://errors.angularjs.org/1.5.3/$injector/unpr?p0=LightBoxProvider%20%3C-%20LightBox%20%3C-%20galleryController
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js:68:12
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js:4418:19
    at Object.getService [as get] (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js:4571:39)
    at http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js:4423:45
    at getService (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js:4571:39)
    at injectionArgs (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js:4595:58)
    at Object.instantiate (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js:4637:18)
    at $controller (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js:10042:28)
    at A.link (http://localhost:63211/js/angular-route.min.js:18:216)
    at invokeLinkFn (http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js:9623:9) <ng-view class="ng-scope">(anonymous function) @ angular.js:13424
http://localhost:63211/gallery Failed to load resource: the server responded with a status of 404 (Not Found)

您需要将注入 galleryController 的依赖项从 LightBox 更改为 Lightbox。 (B在Lightbox中没有大写。)这就解决了问题。