【发布时间】:2017-03-11 17:03:51
【问题描述】:
我通过npm install --save angular-sweetalert 安装了angular-sweetalert ^1.1.2 并尝试注入它:
var app = angular.module('myApp', [
require('angular-sweetalert') // doesn't work
]);
我收到以下错误:
Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:modulerr] Failed to instantiate module undefined due to:
Error: [ng:areq] Argument 'module' is not a function, got undefined
在您的应用中包含文件
我。 SweetAlert.min.js
二。 sweet-alert.js 或 sweet-alert.min.js
在 Angular 中包含模块(即在 app.js 中) - oitozero.ngSweetAlert
任何想法如何正确安装/需要模块?
提前致谢!
【问题讨论】:
标签: javascript angularjs node.js npm sweetalert