kdh93

  • 홈
  • 태그
  • 방명록

2025/01 1

useValue, useClass, useFactory

{ provide: 'CONFIG', useValue: { apiUrl: 'http://api.example.com', timeout: 3000 }}1. useValue 직접 적인 값 주입 설정값, 상수 주입 혹은 테스트용 mock 객체 , 이미 생성된 인스턴스를 주입할 때 사용한다.  { provide: PaymentService, useClass: StripePaymentService}2. useClass클래스의 인스턴스를 주입인터페이스 구현체를 주입할 때, 환경에 따라 다른 구현체를 사용할 때  { provide: 'DATABASE', useFactory: (config: ConfigService) => { return config.isDev ? new Dev..

공부/NestJs 2025.01.11
이전
1
다음
더보기
프로필사진

  • 분류 전체보기 (87)
    • Project (13)
      • TomorrowLand (10)
      • multiplexShop (3)
    • Error (10)
    • 공부 (45)
      • NestJs (1)
      • Test Code (7)
      • Spring (4)
      • Java (4)
      • Linux 기초 (15)
      • JPA (3)
      • OOP (7)
      • Security (3)
      • Server (1)
      • MySQL (0)
      • OS (0)
    • 책 (17)
      • EffectiveJava (3)
      • RealMySQL8.0 (4)
      • CleanCode (9)

Tag

ㅇ, DM,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/01   »
일 월 화 수 목 금 토
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :
gitHub

  • Github

티스토리툴바