AngularJS $UibModal triggering [$injector:unpr]

AngularJS $UibModal triggering [$injector:unpr]

本文关键字:unpr injector UibModal triggering AngularJS      更新时间:2023-09-26

我会保持简短。我是angularjs的新手,我正在学习Pluralsights教程。

自从教程发布以来,有很多不推荐使用的内置插件让我抓狂。

我正在尝试使用以下代码

angularFormsApp.controller("HomeController",
function ($scope, $location, $uibModal, DataService) {
    $scope.showCreateEmployeeForm = function () {
        //$location.path('/newEmployeeForm');            
        $uibModal.open({
            templateUrl: 'app/EmployeeForm/efTemplate.html',
            controller: 'efController'
        });
    })

教程展示了如何使用$modal(现在已弃用)。。。我试着只使用$uibModal,当点击按钮时,事件没有启动,我得到了以下错误

错误:[$injector:unp]http://errors.angularjs.org/1.3.0/$injector/unp?p0=%24animateCssProvider%20%3C-%20%24animateCs%20%3C-%20%24uibModalStack%20%3C-%20%24UIbModal

哦-我也使用NuGet安装了angular,所以我有了最新版本的

animateCssProvider仅适用于角度1.4+,而您使用的是1.3。

来自bootstrap UI网站:

AngularJS(需要AngularJS 1.4.x或更高版本,用1.5.3测试)。0.14.3是该库支持AngularJS 1.3.x的最后一个版本,0.12.0是支持AngularJS1.2.x的最后版本。

只需更新你的角度版本。