나는 듀란 데르 프로젝트를 가지고 있으며, 프로젝트에서 모듈로 작업하는 방식을 개선하려고 노력하고 싶다. 나는 utils
항목을 추가 한요구되는 모듈 명명하기
requirejs.config({
paths: {
'text': '../Scripts/text',
'durandal': '../Scripts/durandal',
'plugins': '../Scripts/durandal/plugins',
'transitions': '../Scripts/durandal/transitions',
'shared': 'shared'
}
});
:
나는 아래의 구성을 가지고있다.
main.js
+App
+shared
-utils.js
-globals.js
...
그래서 내가 정의 콜백 기대했다 다음과 같이 UTILS 모듈을 처리 할 수 있도록 : :이 인라인 일을하고 싶습니다
기본적으로
define(['shared/utils'], function(utils) {
//do stuff
});
유틸 폴더는 다음과 같은 구조를 가지고 듀란 데 콜백.
utils.js and not shared/utils.js in the web inspector.
감사
경로 입력을 삭제하면됩니다. 하위 모듈의 정의는 APP 폴더와 관련이 있으므로 이미 작동해야합니다. – zewa666