
article
Typescript에서 Decorator 사용하기
TS에서 Decorator의 종류 타입스크립트의 데코레이터는 해당 데코레이터가 어느 위치에 있냐에 따라 구현체가 달라진다. 일반 함수에서는 사용할 수 없으며, class로 선언해야 사용할 수 있다. 타입스크립트의 데코레이터는 문법적 설탕이다. 고차함수 / Proxy / Reflect 로 구현되어있다. method decorator class의 method에 사용하는 데코레이터 메서드의 인자, 결과값 등을 받아 다양한 처리를 할 수 있다 parameter → originalMethod, context originalMethod : 해당 클래스에 대한 모든 메서드. 예시에선 { construct:.., style:.., js:.., html:.. } 가 된다. context : 데코레이터를 사용한 함수 이름..