“Unknown provider: ngDialogProvider”

后端 未结 2 814
盖世英雄少女心
盖世英雄少女心 2021-01-18 02:23

In my app.js I have

var app = angular.module(\"atlas\", [\"ngRoute\", \"ngDialog\"]);

for my controller I have



        
2条回答
  •  滥情空心
    2021-01-18 02:33

    the problem was the config of ngDialogProvider

    after var app = angular.module("atlas", ["ngRoute", "ngDialog"]);

    we have to use:

    app.config(["ngDialogProvider", function (ngDialogProvider) {
        ngDialogProvider.setDefaults({
            className: "ngdialog-theme-default",
            plain: false,
            showClose: true,
            closeByDocument: true,
            closeByEscape: true,
            appendTo: false,
            preCloseCallback: function () {
                console.log("default pre-close callback");
            }
        });
    }]); 
    

提交回复
热议问题