ngDialog在mean.js应用 [英] ngDialog in mean.js application

查看:426
本文介绍了ngDialog在mean.js应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了MeanJS web应用程序。我想在应用程序中使用ngDialog,但不知道如何以及在何处添加ngDialog.js在应用程序中。即时试图在控制器注入ngDialog如以下所示,但每次误差为未知提供商

I have created a webapp with MeanJS. I want to use ngDialog in the application, but not sure how and where to add the ngDialog.js in the application. Im trying to inject the ngDialog in the controller as shown below, but everytime error as unknown provider

angular.module('MyModule的')。控制器('myController的',['$范围,$ HTTP,ngDialog',
    功能($范围,$ HTTP,ngDialog){

angular.module('myModule').controller('MyController', ['$scope', '$http', 'ngDialog', function ($scope, $http, ngDialog) {

错误:
 错误:[$喷油器:unpr]未知提供商:ngDialogProvider< - ngDialog

error : Error: [$injector:unpr] Unknown provider: ngDialogProvider <- ngDialog

任何人都可以,请让我知道如何为包括ngDialog在meanjs应用程序。

Can anyone please let me know how to include the ngDialog in the meanjs application.

在此先感谢

推荐答案

您应该使用凉亭先安装 ngDialog 。在您的应用程序根目录(其中bower.json所在地),发出以下命令,

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

凉亭安装--save ngDialog

然后,请确保您的应用程序级别添加ngDialog模块。以下的答案必须是特定于MEAN.JS。

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

在文件公共/ 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文件到角应用程序的HTML模板。

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

在文件配置/ ENV / all.js的,找到 assets.lib.css ,追加公共/ 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 ,追加公共/ 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.

这篇关于ngDialog在mean.js应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆