尝试使用ngDialog时未定义的错误 [英] Undefined error when trying to use ngDialog

查看:117
本文介绍了尝试使用ngDialog时未定义的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用凉亭安装ngDialog模块 - 请参见这里我试图实例化模块中的我app.js与我依赖的其他文件,就像这样:

I used bower to install the ngDialog module- see here I am trying to instantiate the module in my app.js file with the rest of my dependencies, like so:

var app = angular.module('myApp', [
    'ngResource',
    'ngRoute',
    'ngCookies',
    'ui.bootstrap',
    'ngDialog',
    'myApp.services',
    'myApp.directives',
    'myApp.controllers',

]);

但是当我构建应用程序,并尝试在浏览器中打开它,我得到一个空白页和一个错误说:

but when I build the app and try to open it in a browser, I get a blank page and an error saying:

Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:modulerr] Failed to instantiate module ngDialog due to:
Error: [$injector:nomod] Module 'ngDialog' is not available! You either misspelled the ...

任何人都可以提出建议,为什么?

Can anyone advise why?

推荐答案

此问题是你没有包括中的JavaScript功能index.html文件。指示

This problem is an indication you did not include that javascript in your index.html file.

您有一个定义ngDialog一个JavaScript文件,确保它被加载到浏览器。

You have a javascript file that defines ngDialog, make sure it was loaded by the browser.

这篇关于尝试使用ngDialog时未定义的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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