gpt4 book ai didi

javascript - AngularJS $UibModal 触发 [$injector :unpr]

转载 作者:行者123 更新时间:2023-12-03 07:09:15 25 4
gpt4 key购买 nike

我会保持简短。我对 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 代替,当单击按钮时,事件未触发,并且出现以下错误

Error: [$injector:unpr] http://errors.angularjs.org/1.3.0/$injector/unpr?p0=%24animateCssProvider%20%3C-%20%24animateCss%20%3C-%20%24uibModalStack%20%3C-%20%24uibModal

哦 - 我还使用 NuGet 安装了 Angular,所以我拥有最新版本

最佳答案

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

来自 bootstrap UI 网站:

AngularJS (requires AngularJS 1.4.x or higher, tested with 1.5.3). 0.14.3 is the last version of this library that supports AngularJS 1.3.x and 0.12.0 is the last version that supports AngularJS 1.2.x.

只需更新您的 Angular 版本即可。

关于javascript - AngularJS $UibModal 触发 [$injector :unpr],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36682492/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com