本文介绍了ngGrid 注入 ng-app 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:modulerr] Failed to instantiate module ngGrid due to:
Error: [$injector:nomod] Module 'ngGrid' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

以上是我收到的错误信息.我已经在 angularjs、jquery 之后加载了 ng-grid 脚本.我像这样将它注入到应用程序中:

Above is the error message I received.I have loaded the ng-grid script AFTER angularjs, jquery.I injected it into app like this:

var myApp = angular.module('myApp', ['ui.bootstrap','ngRoute', 'ngResource','ngGrid'])
.controller('myAppCtrl', myAppCtrl);

不知道我哪里做错了?

===更新

这是我的标题

<!-- Angular Libs -->
<script type="text/javascript" src="/library/angularjs/1.2.9/angular.js"></script>
<script type="text/javascript" src="/library/angularjs/1.2.9/angular-route.js"></script>
<script type="text/javascript" src="/library/angularjs/1.2.9/angular-resource.js"></script>
<!-- jQuery Libs -->
<script type="text/javascript" src="/library/jquery/2.1.1/jquery.js"></script>

<!-- Third-party Libs -->
<script type="text/javascript" src="/library/angular-ui/bootstrap/0.11.0/ui-bootstrap-tpls.js"></script>
<script type="text/javascript" src="/library/angular-ui/ng-grid3/2.0.7/ng-grid.js"></script>

他们都找到了.Chrome Inspector 中没有返回 404 的错误

They are all found. No error of 404 return in Chrome Inspector

推荐答案

USE ui.grid not ngGrid

USE ui.grid not ngGrid

是的.像它一样愚蠢.被官方的GetStarted搞糊涂了,哈哈

yea. as stupid as it is. Confused by its official GetStarted lol

这篇关于ngGrid 注入 ng-app 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 16:06