2014-09-09 2 views
2
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. 

위 오류 메시지가 표시됩니다. anggj, jquery 후에 ng-grid 스크립트를로드했습니다. 이 같은 응용 프로그램으로 주입 :ng-app에 ngGrid 주입이 실패했습니다.

내가 잘못된 곳을 했는가 궁금
var myApp = angular.module('myApp', ['ui.bootstrap','ngRoute', 'ngResource','ngGrid']) 
.controller('myAppCtrl', myAppCtrl); 

?

===의 UPDATE

여기 그들은 모두 발견 내 헤더

<!-- 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> 

입니다. 크롬 경감

+0

ng-grid.js가로드되어 있는지 확인하십시오. CDN은 매우 자주 다운됩니다. – mainguy

+0

@mainguy 웹 사이트에서 lib를 다운로드했습니다. 그것의 로컬 호스팅. 파일을 찾을 수없는 경우 오류가 반환되지 않습니다. – Ezeewei

+0

HTML 파일의 "머리"를 공유해 주실 수 있습니까? 또는 스크립트 선언이 없으면 스크립트 선언이있는 부분을 공유하십시오. – Josep

답변

6

사용 ui.grid 404 반환의 어떤 오류가없는

터무니 ngGrid 없습니다. 그만큼 어리 석다. 그것의 공식 GetStarted 롤에 의해 혼동

+0

ui.grid가 ngGrid를 대체했으며 ngGrid가 더 이상 사용되지 않습니다. 당신의 대답은 제가 감사합니다 내 문제를 알아내는 데 도움이, 감사합니다. – adamdport

+0

정답으로 표시해야합니다. –

0

나는 ui-grid와 함께 오류를 직면하고 있었고, 다음 ng-grid를 사용하여 해결했습니다.

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.min.css" /> 
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.min.js"></script> 
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.min.js"></script> 
관련 문제