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 | 29 | 30 | 31 |
Tags
- 호버
- mysql if
- 스크롤 이벤트
- angular button
- 아이오닉 스크롤 이벤트
- formgroup
- egov spring ajax 사용 예시
- 앵귤러 애니메이션
- angular animation
- TAILWIND
- prisma
- ajax 사용 예시
- scroll
- 옵저버블
- 모달
- Angular Router
- flex-1
- Oracle LISTAGG 사용 예시
- modal
- Ionic modal
- 앵귤러 모달
- Router
- 스크롤 이벤트 감지
- angular modal
- route
- 검색
- ApexChart
- summary
- angular route
- 셀렉트박스 커스텀
Archives
- Today
- Total
깜놀하는 해므찌로
angular modal dismiss 예시 본문
반응형
SMALL
delete() {
const items = localStorage.getItem('orderInfos');
let orderInfos: OrderInfo[] = [];
if (items) {
orderInfos = JSON.parse(items);
const index = orderInfos.findIndex(
(orderInfo: OrderInfo) => orderInfo.id === this.orderInfo.id
);
orderInfos.slice(index, 1);
localStorage.setItem('orderInfos', JSON.stringify(orderInfos));
}
this.modalController.dismiss(null, 'confirm');
}
1. dismiss 할 시 role 을 활용하자
2. role 값에 'confirm' 할당
async deleteOrderInfo() {
const modal = await this.modalController.create({
component: DeleteOrderModal,
componentProps: {
orderInfo: this.orderInfo,
},
});
modal.onDidDismiss().then((res) => {
if (res.role === 'confirm') {
this.router.navigateByUrl('/order', { replaceUrl: true });
}
});
modal.present();
}
3. res.role 접근할 수 있습니다.
반응형
LIST
'IT' 카테고리의 다른 글
Video width height 동영상 화면 비율 조정하기 CSS Tailwind / aspect-video (0) | 2023.06.19 |
---|---|
Angular 데이터 길이만큼 배열 생성 (0) | 2023.06.19 |
vsCode Prettier 저장 시 정렬하도록 셋팅하기 (0) | 2023.06.17 |
angular table 사용 예시 (0) | 2023.06.17 |
summary, details tag toggle marker delete (0) | 2023.06.16 |