사용자 도구

사이트 도구


angular:service

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판이전 판
다음 판
이전 판
angular:service [2019/08/15 15:09] – [HttpClient] taekguangular:service [2025/04/15 10:05] (현재) – 바깥 편집 127.0.0.1
줄 1: 줄 1:
-===== Service ===== +====== Service ====== 
-A class with a specific purpose+ 
-  - Share data +**Angular**는 //component//기반으로 작성하고자 한다소스는 독립성을 두어야 할 필요가 있다. 그중하나가 service라는 개념이다. service는 특별한 목적을 가지는 클래스이다. **Injectable** annotation을 사용하여 DI((Dependency Injection))을 제공한다. 
-  - Implement application logic +<wrap em> 
-  - External Interaction +  - 데이타 공유 
-Naming convention - .service.ts +  - 응용프로그램 로직 구현 
-<code javascript>+  - 외부 접속창구 역할 
 +</wrap> 
 +===== Sample ===== 
 +<code javascript employee.service.ts>
 import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
  
줄 28: 줄 31:
 ==== HttpClient ==== ==== HttpClient ====
 [[angular:httpclient|HttpClient]] [[angular:httpclient|HttpClient]]
-<code javascript>+<code javascript employee.service.ts>
 import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
 import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { HttpClient, HttpErrorResponse } from '@angular/common/http';
angular/service.1565881755.txt.gz · 마지막으로 수정됨: 2025/04/15 10:05 (바깥 편집)