Enterprise APP

Angular 프로젝트 production 반영시 고려사항 본문

Angular 1.X

Angular 프로젝트 production 반영시 고려사항

로드스타 2017. 3. 6. 11:57

* Directive의 특성상 재귀호출이 이루어지는 scope 설정을 isolated scope로 사용해야 할 필요성이 있는지 확인

* scope 데이터와 DOM 상호 Two-way binding이 필요한가? -> 1.5.5 부터 지원되는 `<` one-way 바인딩 지시자로 대치

* Disabling Debug Data : 컴파일시 각 엘리먼트별 debuggin용 ng-scope를 생성하는데 production에서는 필요없으니(stage에서는 on) 기능을 off 시킬 것(default는 true)

myApp.config(['$compileProvider', function ($compileProvider) {

  $compileProvider.debugInfoEnabled(false);

}]);


 

* html, css에 포함된 주석은 컴파일에서 제외

$compileProvider.commentDirectivesEnabled(false);

$compileProvider.cssClassDirectivesEnabled(false);

* Running an AngularJS App in Production


Comments