未捕获错误:未知提供者:$ templateRequestProvider < - $ templateRequest < - $ modal

E S*_*ger 11 twitter-bootstrap angularjs bootstrap-modal

你好Stackoverflowers;)

关于bootstrap.ui模式的这个特殊问题我有点费力:

未捕获错误:未知提供者:$ templateRequestProvider < - $ templateRequest < - $ modal

我已经尝试定义提供程序,但我无法使其正常工作.

这是我的app.js:

var app = angular.module('stelping', ['ui.bootstrap']).
config(['$routeProvider', function ($routeProvider) {
    $routeProvider.
        when('/', {
            templateUrl: 'pages/home.html',
            controller: HomeCtrl,
            activetab: 'home'
        }).
        when('/notentool', {
            templateUrl: 'pages/notentool.html',
            controller: NotentoolCtrl,
            activetab: 'notentool'
        }).
        when('/lerngruppe', {
            templateUrl: 'pages/lerngruppe.html',
            controller: LerngruppenCtrl,
            activetab: 'lerngruppe'
        }).
        when('/raumreservierung', {
            templateUrl: 'pages/raumreservierung.html',
            controller: RaumreservierungCtrl,
            activetab: 'raumreservierung'
        }).
        when('a', function() {
            return {
                restrict: 'E',
                link: function(scope, elem, attrs) {
                    if(attrs.ngClick || attrs.href === '' || attrs.href === '#'){
                        elem.on('click', function(e){
                            e.preventDefault();
                        });
                    }
            }
        }}).
        when('/registrieren', {
            templateUrl: 'pages/registrieren.html',
            controller: RegistrierungsCtrl,
            activetab: 'registrieren'
        }).
        otherwise({ redirectTo: '/' });
}]).run(['$rootScope', '$modal', '$log', '$http', '$browser', '$timeout', "$route", function ($scope, $modal, $log, $http, $browser, $timeout, $route) {

    $scope.$on("$routeChangeSuccess", function (scope, next, current) {
        $scope.part = $route.current.activetab;
    });


}]);

app.config(['$locationProvider', function($location) {
    $location.hashPrefix('!');
}]);
Run Code Online (Sandbox Code Playgroud)

这是我的controller.js(部分只是两个新的Ctrls):

function LerngruppenCtrl($scope, $modal, $log) {
$scope.buildings = [ 1, 5, 6 ];
$scope.rooms = [ 0, 1, 2, 3, 4 ];
$scope.currentBuilding = 1;
$scope.currentRoom = 0;
$scope.setRoom = function(room) {
    $scope.currentRoom = room;
}
$scope.setBuilding = function(building) {
    $scope.currentBuilding = building;
}
$scope.imgChanger = function() {
    return $scope.currentBuilding+"_"+$scope.currentRoom;
};
$scope.class = "hidden";

$scope.open = function (size) {

    var modalInstance = $modal.open({
        templateUrl: 'myModalContent.html',
        controller: 'ModalInstanceCtrl',
        size: size
    });
    modalInstance.result.then(function () {
        $log.info('Modal dismissed at: ' + new Date());
    });
};
}

function ModalInstanceCtrl($scope, $modalInstance) {
    $scope.cancel = function () {
        $modalInstance.dismiss('cancel');
    };
}
Run Code Online (Sandbox Code Playgroud)

Dyl*_*att 30

该错误是由于ui.bootstrap和版本之间的不匹配造成的angular.ui.bootstrap.13取决于1.3x,.12取决于1.2x.