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
- 모달
- route
- angular animation
- modal
- 아이오닉 스크롤 이벤트
- ApexChart
- Oracle LISTAGG 사용 예시
- Angular Router
- 스크롤 이벤트
- 호버
- 앵귤러 모달
- angular modal
- 검색
- ajax 사용 예시
- flex-1
- angular route
- angular button
- 셀렉트박스 커스텀
- formgroup
- Router
- Ionic modal
- summary
- 앵귤러 애니메이션
- mysql if
- scroll
- egov spring ajax 사용 예시
- prisma
- TAILWIND
- 스크롤 이벤트 감지
- 옵저버블
Archives
- Today
- Total
깜놀하는 해므찌로
Typescript Angular 넘버 포멧 pipe 생성 예시 본문
반응형
SMALL
ng generate pipe numberFormat --skip-import
1. CLI : pipe 생성
2. 생성 완료
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'numberFormat',
standalone: true,
})
export class NumberFormatPipe implements PipeTransform {
transform(value: string | number, args: string): string {
return value.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ',');
}
}
3. standalone true
4. 숫자 콤마처리
import { NumberFormatPipe } from 'src/app/pipes/number-format.pipe';
imports: [NumberFormatPipe]
5. 사용할 곳에서 로드하기
{{item.totalPrice | numberFormat : ''}}
6. 템플릿 호출 예시
반응형
LIST
'IT' 카테고리의 다른 글
Angular 이벤트 중간에 끊기 (0) | 2023.05.08 |
---|---|
'node' 용어가 cmdlet, 함수, 스크립트 파일 또는 실행할 수 있는 프로그램 이름으로 인식되지 않습니다. 이름이 정확한지 확인하고 경로가 포함된 경우 경로가 올바른지 검증한 다음 다시 시도하.. (0) | 2023.05.08 |
Typescript entries 사용 예시 (0) | 2023.05.08 |
Typescript 목데이터 가데이터 만들기 예시 (0) | 2023.05.08 |
Tailwind CSS 마우스 클릭 시 border (0) | 2023.05.07 |