From 3300c6d579a22a49cc0b5b0fca0f5753379efae9 Mon Sep 17 00:00:00 2001 From: JUNG YI DAM Date: Fri, 19 Aug 2022 10:34:56 +0000 Subject: [PATCH] =?UTF-8?q?=ED=8C=8C=EC=9B=8C=EB=B3=BC=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=EC=95=8C=EB=A6=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../powerball/components/list.component.html | 1 + .../powerball/components/list.component.ts | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/app/modules/admin/game/powerball/components/list.component.html b/src/app/modules/admin/game/powerball/components/list.component.html index 06cf391..c772870 100644 --- a/src/app/modules/admin/game/powerball/components/list.component.html +++ b/src/app/modules/admin/game/powerball/components/list.component.html @@ -202,6 +202,7 @@ mat-flat-button class="bet-mat-small-8" [color]="'warn'" + (click)="__onClickRemoveBtn($event, powerball.id)" > 삭제 diff --git a/src/app/modules/admin/game/powerball/components/list.component.ts b/src/app/modules/admin/game/powerball/components/list.component.ts index cd0e4e1..900138f 100644 --- a/src/app/modules/admin/game/powerball/components/list.component.ts +++ b/src/app/modules/admin/game/powerball/components/list.component.ts @@ -79,6 +79,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { private _unsubscribeAll: Subject = new Subject(); + configForm!: FormGroup; /** * Constructor */ @@ -109,6 +110,29 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { this._changeDetectorRef.markForCheck(); }); + this.configForm = this._formBuilder.group({ + title: '알림', + message: + '정말로 삭제하시겠습니까? 삭제!', + icon: this._formBuilder.group({ + show: true, + name: 'heroicons_outline:exclamation', + color: 'warn', + }), + actions: this._formBuilder.group({ + confirm: this._formBuilder.group({ + show: true, + label: '삭제', + color: 'warn', + }), + cancel: this._formBuilder.group({ + show: true, + label: '취소', + }), + }), + dismissible: true, + }); + // Get the products this.powerballs$ = this._powerballService.powerballs$; } @@ -177,6 +201,15 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { // @ Private methods // ----------------------------------------------------------------------------------------------------- + __onClickRemoveBtn(event: MouseEvent, id: string): void { + // Open the dialog and save the reference of it + const dialogRef = this._fuseConfirmationService.open(this.configForm.value); + + // Subscribe to afterClosed from the dialog reference + dialogRef.afterClosed().subscribe((result) => { + console.log(result); + }); + } /** * Create product */