# Services & Dependency Injection (Angular) > Services, @Injectable, providedIn, dependency injection, hierarchical injectors, injection tokens, providers - 20 면접 질문 - Junior - [면접 질문: Angular](https://sharpskill.dev/ko/technologies/angular/interview-questions.md) ## 1. Angular에서 service란 무엇인가요? **답변** service는 @Injectable로 데코레이트된 TypeScript 클래스로, 비즈니스 로직이나 공유 데이터를 캡슐화합니다. service는 재사용 가능한 로직을 컴포넌트에서 추출하여 관심사 분리 원칙을 따릅니다. Angular의 dependency injection 시스템을 통해 다른 클래스에 주입될 수 있어 코드의 모듈성과 테스트 가능성을 향상시킵니다. ## 2. Angular에서 클래스를 injectable하게 만드는 데코레이터는 무엇인가요? **답변** @Injectable 데코레이터는 클래스가 Angular의 dependency injection 시스템에서 service로 사용되기 위해 필수입니다. 이 데코레이터는 Angular가 service의 의존성을 해결하는 데 필요한 메타데이터를 생성할 수 있게 합니다. @Injectable이 없으면 TypeScript 컴파일러는 injection에 필요한 타입 정보를 보존하지 않아 런타임 오류를 발생시킵니다. ## 3. 기본 service를 생성하는 올바른 구문은 무엇인가요? **답변** Angular service를 생성하는 완전한 구문에는 @angular/core에서 Injectable 데코레이터를 임포트한 다음 providedIn 옵션과 함께 클래스에 적용하는 것이 포함됩니다. 이 최신 구성은 service를 애플리케이션의 루트 injector에 자동으로 등록합니다. providedIn: 'root' 옵션은 tree-shaking을 가능하게 하고 전역 싱글톤을 보장하므로 모범 사례입니다. ## 17개 추가 질문 이용 가능 - @Injectable의 providedIn: 'root'는 무엇을 의미하나요? - 컴포넌트에 service를 어떻게 주입하나요? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Angular 면접 주제 - [TypeScript 기초](https://sharpskill.dev/ko/technologies/angular/interview-questions/typescript-basics.md): 25개 질문, Junior - [TypeScript 고급](https://sharpskill.dev/ko/technologies/angular/interview-questions/typescript-advanced.md): 20개 질문, Junior - [Angular 기초](https://sharpskill.dev/ko/technologies/angular/interview-questions/angular-fundamentals.md): 20개 질문, Junior - [컴포넌트와 라이프사이클](https://sharpskill.dev/ko/technologies/angular/interview-questions/components-lifecycle.md): 20개 질문, Junior - [Angular 모듈 구성](https://sharpskill.dev/ko/technologies/angular/interview-questions/modules-organization.md): 22개 질문, Mid-Level - [Angular CLI](https://sharpskill.dev/ko/technologies/angular/interview-questions/angular-cli.md): 18개 질문, Junior - [디렉티브와 Pipe](https://sharpskill.dev/ko/technologies/angular/interview-questions/directives-pipes.md): 22개 질문, Mid-Level - [라우팅과 내비게이션](https://sharpskill.dev/ko/technologies/angular/interview-questions/routing-navigation.md): 24개 질문, Mid-Level - [리액티브 폼](https://sharpskill.dev/ko/technologies/angular/interview-questions/forms-reactive.md): 26개 질문, Mid-Level - [템플릿 기반 폼](https://sharpskill.dev/ko/technologies/angular/interview-questions/forms-template-driven.md): 16개 질문, Mid-Level - [RxJS 기초](https://sharpskill.dev/ko/technologies/angular/interview-questions/rxjs-fundamentals.md): 22개 질문, Mid-Level - [RxJS 연산자](https://sharpskill.dev/ko/technologies/angular/interview-questions/rxjs-operators.md): 24개 질문, Mid-Level - [HttpClient 및 API 호출](https://sharpskill.dev/ko/technologies/angular/interview-questions/http-client.md): 22개 질문, Mid-Level - [기본 상태 관리](https://sharpskill.dev/ko/technologies/angular/interview-questions/state-management-basics.md): 20개 질문, Mid-Level - [Change Detection](https://sharpskill.dev/ko/technologies/angular/interview-questions/change-detection.md): 20개 질문, Mid-Level - [Angular Signals](https://sharpskill.dev/ko/technologies/angular/interview-questions/angular-signals.md): 20개 질문, Mid-Level - [Standalone Components](https://sharpskill.dev/ko/technologies/angular/interview-questions/standalone-components.md): 18개 질문, Mid-Level - [Angular 단위 테스트](https://sharpskill.dev/ko/technologies/angular/interview-questions/testing-unit.md): 22개 질문, Mid-Level - [엔드투엔드 테스팅](https://sharpskill.dev/ko/technologies/angular/interview-questions/testing-e2e.md): 18개 질문, Mid-Level - [빌드 및 최적화](https://sharpskill.dev/ko/technologies/angular/interview-questions/build-optimization.md): 20개 질문, Mid-Level - [NgRx 기초](https://sharpskill.dev/ko/technologies/angular/interview-questions/ngrx-fundamentals.md): 24개 질문, Senior - [NgRx 고급](https://sharpskill.dev/ko/technologies/angular/interview-questions/ngrx-advanced.md): 24개 질문, Senior - [Angular 아키텍처](https://sharpskill.dev/ko/technologies/angular/interview-questions/angular-architecture.md): 22개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/angular/interview-questions/performance-optimization.md): 22개 질문, Senior - [보안 및 모범 사례](https://sharpskill.dev/ko/technologies/angular/interview-questions/security-best-practices.md): 20개 질문, Senior - [고급 RxJS 패턴](https://sharpskill.dev/ko/technologies/angular/interview-questions/advanced-rxjs-patterns.md): 22개 질문, Senior - [Angular Universal 및 SSR](https://sharpskill.dev/ko/technologies/angular/interview-questions/angular-universal-ssr.md): 20개 질문, Senior - [Angular 마이크로 프론트엔드](https://sharpskill.dev/ko/technologies/angular/interview-questions/micro-frontends-angular.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/angular/interview-questions/services-dependency-injection