Angularjs directive 在指令中使用ngDialog

Angularjs directive 在指令中使用ngDialog,angularjs-directive,Angularjs Directive,我正在尝试从此处下载工作对话框: 这是我的密码: <script src="http://cdnjs.cloudflare.com/ajax/libs/ng-dialog/0.2.3/js/ngDialog.min.js"></script> 我的指示: directives = angular.module("mainApp", ['ngDialog']); directives.directive('caseList', function () { return {

我正在尝试从此处下载工作对话框:

这是我的密码:

<script src="http://cdnjs.cloudflare.com/ajax/libs/ng-dialog/0.2.3/js/ngDialog.min.js"></script>
我的指示:

directives = angular.module("mainApp", ['ngDialog']);
directives.directive('caseList', function () {
return {
    restrict: 'AE',
    require: 'ngModel',
    link: function (scope, elem, attrs, ngModel, ngDialog) {
    ......
     ngDialog.open({
                    template: '<p>my template</p>',
                    plain: true
                });
我得到一个错误: 未捕获的TypeError:无法读取未定义的属性“open” 正在检查ngDialog对象,但该对象未定义


我到底做错了什么?

这里是哪里做错了。ngDialog应已注入指令定义中: 指令:

directives.directive('caseList', function (**ngDialog**) {
无需将其注入链接函数