我已将 ngDialog 添加到我的 angularjs 应用程序中,并将其注入我的模块后,这就是我得到的:
未捕获的错误:不匹配的匿名 define() 模块:函数 (a){"use strict";var b=a.module("ngDialog",[]),c=a.element,d=a.isDefined,e=( document.body||document.documentElement).style,f=d(e.animation)||d(e.WebkitAnimation)||d(e.MozAnimation)||d(e.MsAnimation)||d(e. OAnimation),g="animationend webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend",h="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled ]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]",i=!1,j={},k=[],l=!1;return b.provider("ngDialog",function(){var b=this.defaults={className:"ngdialog-theme-default",plain:!1,showClose:!0,closeByDocument:!0,closeByEscape:!0, closeByNavigation:!1,appendTo:!1,preCloseCallback:!1,overlay:!0,cache:!0,trapFocus:!0,preserveFocus:!0,ariaAuto:!0,ariaRole:null,ariaLabelledById:null,ariaLabelledBySelec
这个错误的原因是什么?我必须修改 ngDialog.js 代码吗?
添加信息:在 module.js 中注入:
var app = angular.module('myApp', ['...', ...., 'ngDialog']);
*** 当我像这样在我的控制器中注入 ngdialog 时:
app.controller('myController', ['$scope','$http','ngDialog', function ($scope,$http,ngDialog) { ...
这是我得到的错误:
Error: [$injector:unpr] Unknown provider: ngDialogProvider <- ngDialog <- inventoryController