File

src/app/GN2CommonModule/others/modal-confirmation/confirmation.dialog.ts

Metadata

selector gn-confirmation-dialog
styleUrls confirmation.dialog.scss
templateUrl confirmation.dialog.html

Constructor

constructor(dialogRef: any, options: any)

Methods

onNoClick
onNoClick()
Returns: void

Properties

_message
_message: string
_noColor
_noColor: string
Default value: basic
_yesColor
_yesColor: string
Default value: warn
data
data: any
dialogRef
dialogRef: any
message
message: any
noColor
noColor: any
options
options: any
yesColor
yesColor: any
import { Component, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';

@Component({
  selector: 'gn-confirmation-dialog',
  templateUrl: './confirmation.dialog.html',
  styleUrls: ['./confirmation.dialog.scss'],
})
export class ConfirmationDialog {
  data: any;
  _yesColor: string = 'warn';
  _noColor: string = 'basic';
  _message: string = null;

  get yesColor() {
    return this.data.yesColor ? this.data.yesColor : this._yesColor;
  }
  get noColor() {
    return this.data.noColor ? this.data.noColor : this._noColor;
  }
  get message() {
    return this.data.message ? this.data.message : this._message;
  }

  constructor(
    public dialogRef: MatDialogRef<ConfirmationDialog>,
    @Inject(MAT_DIALOG_DATA) public options: any
  ) {
    this.data = options;
  }

  onNoClick(): void {
    this.dialogRef.close();
  }
}

results matching ""

    No results matching ""