且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

mean.js 应用程序中的 ngDialog

更新时间:2023-11-30 13:20:10

你应该先用 bower 安装 ngDialog.在您的应用程序根目录(bower.json 所在的位置)中,发出以下命令,

You should use bower to install ngDialog first. In your application root (where bower.json is located), issue the following command,

bower install --save ngDialog

然后,确保在应用级别添加 ngDialog 模块.以下答案特定于 MEAN.JS.

Then, make sure you add ngDialog module in the app level. The following answer is specific to MEAN.JS.

在文件public/config.js中,找到一行

var applicationModuleVendorDependencies = ['ngResource', 'ngCookies', 'ngAnimate', 'ngTouch', 'ngSanitize', 'ui.router', 'ui.bootstrap', 'ui.utils'];代码>

在列表末尾添加'ngDialog'

var applicationModuleVendorDependencies = ['ngResource', 'ngCookies', 'ngAnimate', 'ngTouch', 'ngSanitize', 'ui.router', 'ui.bootstrap', 'ui.utils', 'ngDialog'];

然后,将 ngDialog 的 CSS 和 JavaScript 文件包含到 Angular 应用程序的 HTML 模板中.

Then, include ngDialog's CSS and JavaScript file into the HTML template of the Angular application.

在文件config/env/all.js中,找到assets.lib.css,追加'public/lib/ngDialog/css/ngDialog.min.css' 到列表中.

In file config/env/all.js, find assets.lib.css, append 'public/lib/ngDialog/css/ngDialog.min.css' to the list.

在同一个文件中,找到assets.lib.js,将'public/lib/ngDialog/js/ngDialog.min.js'追加到列表中.

In the same file, find assets.lib.js, append 'public/lib/ngDialog/js/ngDialog.min.js' to the list.