testing out eg-confirm-dialog user/sandbergja/testing-out-confirmation-modal
authorJane Sandberg <sandbej@linnbenton.edu>
Wed, 19 Dec 2018 23:51:25 +0000 (15:51 -0800)
committerJane Sandberg <sandbej@linnbenton.edu>
Wed, 19 Dec 2018 23:53:17 +0000 (15:53 -0800)
Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts

index 289ed50..003df23 100644 (file)
@@ -130,4 +130,13 @@ HERasdfE
 
 <br/><br/>
 
+<button (click)="confirmNumber(1)">Confirm 1</button>
+<button (click)="confirmNumber(0)">Confirm 0</button>
+<button (click)="confirmNumber(20)">Confirm 20</button>
+
+<eg-confirm-dialog #numberConfirmDialog
+  i18n-dialogTitle i18n-dialogBody
+  dialogTitle="Confirm Number"
+  dialogBody="Are you sure you want to confirm {numThings, plural, =1 {this thing} other {these {{numThings}} things}}?">
+</eg-confirm-dialog>
 
index 92b18dc..69c8672 100644 (file)
@@ -30,6 +30,11 @@ export class SandboxComponent implements OnInit {
     @ViewChild('printTemplate')
     private printTemplate: TemplateRef<any>;
 
+    @ViewChild('numberConfirmDialog')
+    private numConfirmDialog: ConfirmDialogComponent;
+
+    public numThings: number = 0;
+
     // @ViewChild('helloStr') private helloStr: StringComponent;
 
     gridDataSource: GridDataSource = new GridDataSource();
@@ -183,6 +188,13 @@ export class SandboxComponent implements OnInit {
                 .then(txt => this.toast.success(txt));
         }, 4000);
     }
+
+    confirmNumber(num: number): void {
+      this.numThings = num;
+      console.log(this.numThings);
+      this.numConfirmDialog.open();
+    }
+
 }