기존 응용 프로그램에 AngularJS를 통합하는 방법을 찾으려고합니다. 응용 프로그램은 모듈 식이므로 모든 모듈에는 HTML 마크 업과 JS 스크립트 파일이 있습니다. 모듈은 requirejs 및 jQuery (마크 업로드 용)로로드됩니다.AngularJS를 기존 모듈 식 응용 프로그램에 통합
미래의 AngularJS 로의 마이그레이션 가능성을 염두에두고 모듈의 일부에서 AngularJS 기능을 사용하고 싶습니다. 그래서 이상적으로 나는 다음과 같은 것을 원합니다.
define([ 'angular' ], function (angular) {
return function (element) {
// The "element" parameter contains the reference to
// the detached DOM node that contains the markup.
// And what I think should be done is compiling
// or initializing AngularJS with the given DOM HTML fragment
// and with controller, etc.
angular.doSomething(element, ...something...);
// The application module engine will inject the returned element
// into the DOM tree.
return element;
};
});
아이디어가 있습니까? 감사!