import { Component , OnInit , Input , Output , EventEmitter } from '@angular/core' ; import { Router } from "@angular/router" ; @ Component ( { selector : 'app-confirm-modal' , templateUrl : './confirm-modal.component.html' , styleUrls : [ './confirm-modal.component.scss' ] } ) export class ConfirmModalComponent implements OnInit { constructor ( private router ) { } private _show ; @ Input ( ) confirmTitle = 'Confirm' ; @ Input ( ) confirmMessage = 'Are you sure you want to do this?' ; @ Input ( ) confirmButton = 'Continue' ; @ Input ( ) set show ( value ) { this . _show = value ; this . showChange . emit ( this . _show ) ; } get show ( ) { return this . _show ; } @ Output ( ) showChange = new EventEmitter ( ) ; @ Output ( ) onConfirm = new EventEmitter ( ) ; onConfirmInner ( $event ) { this . onConfirm . emit ( ) ; this . close ( ) ; } ngOnInit ( ) { } close ( ) { this . show = false ; } }