내 응용 프로그램에서 여러 모듈을, JS 분리 된 파일의 모든 모듈 정의 :이에서여러 모듈로드 오류
angular.module('app.module1.module2').controller('myController', function(){});
: 내가 지난 모듈 컨트롤러를 만들려면 다음
angular.module('app', ['app.module1']);
angular.module('app.module1', ['app.module1.module2']);
angular.module('app.module1.module2', []);
그리고 케이스에 오류가 있습니다
Module 'app.module1.module2' 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.
어디에서 문제를 설명 할 수 있습니까? 초보자 질문에 대해 유감입니다. 참고 : 모든 정의는 자체 js 파일입니다.
app.module1.module2에서 컨트롤러를 어디에서 만들고 있습니까? app.module.module2 모듈을 만드는 위치와 다른 파일에 있습니까? 다른 파일에 있으면 모듈 선언 파일을 먼저로드해야합니다. – theJoeBiz
http://plnkr.co/edit/L310PHMhewEZMakGKBGv?p=preview @theJoeBiz –
@theJoeBiz에 따라 모든 모듈이로드되기 전에 컨트롤러를 만들어야합니다. 예, 서로 다른 파일입니다. 하지만 모듈 로딩이 앵귤러 부트 스트래핑 후에 만 일어날 것이라고 생각했습니다. – havenchyk