我已经按照描述中给出的安装过程进行操作,但出现错误:
Error: [$injector:unpr] Unknown provider: 19degrees.ngSweetAlert2Provider <- 19degrees.ngSweetAlert2 <- prkctrl`
我包含了 sweetalert.js
(原始 sweetalert
)、sweetalert2
(扩展版)和 ngsweetalert2
(来自这个项目)。
我还是不明白是什么原因?名字可能是个问题?
最佳答案
确保您已将模块 19degrees.ngSweetAlert2
添加到您的主应用程序中,例如:
angular.module('myApp', ['19degrees.ngSweetAlert2', /* and other modules */]
关于javascript - 无法在 AngularJS 中注入(inject) Ng-SweetAlert-2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34525547/