Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 아이오닉 스크롤 이벤트
- 호버
- prisma
- 모달
- 스크롤 이벤트
- ApexChart
- 옵저버블
- mysql if
- 검색
- TAILWIND
- 앵귤러 모달
- egov spring ajax 사용 예시
- route
- angular route
- scroll
- modal
- angular button
- Angular Router
- angular modal
- Oracle LISTAGG 사용 예시
- 앵귤러 애니메이션
- Ionic modal
- formgroup
- Router
- 스크롤 이벤트 감지
- summary
- 셀렉트박스 커스텀
- ajax 사용 예시
- angular animation
- flex-1
Archives
- Today
- Total
깜놀하는 해므찌로
typescript static 정적 변수 활용 예시 본문
반응형
SMALL
class Car{
#privat:number = 30;
protected protect:string = "protected";
readonly name:string = "Car"; // readonly 수정 불가능
static staticName = "정적 변수";
// color:string;
constructor(public readonly color:string, name:string){
this.color = color;
this.name = name; // readonly 수정할 수 있도록 생성자에서 처리
}
start(){
console.log("start");
console.log(this.#privat); // private
console.log(Car.staticName); // static 변수 사용 시 this 대신 class이름 사용
}
}
반응형
LIST
'IT' 카테고리의 다른 글
Angular 의존성 주입 예시 (0) | 2023.05.26 |
---|---|
Uncaught (in promise): NullInjectorError: R3InjectorError(Standalone[LayoutPage])[HttpService -> HttpService -> HttpService -> HttpClient -> HttpClient]: 에러 해결 (0) | 2023.05.25 |
Tailwind 단어 단위 줄바꿈 CSS (0) | 2023.05.24 |
typescript readonly 활용 예시 (0) | 2023.05.24 |
@Observable @subscribe() (0) | 2023.05.23 |