import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; @Component({ selector: 'lib-result-confirm', templateUrl: './result-confirm.component.html', styleUrls: ['./result-confirm.component.css'] }) export class ResultConfirmComponent implements OnInit { @Input() dialogRef: any = null; @Input() rows: number = 0; @Output() confirmed = new EventEmitter(); @Output() canceled = new EventEmitter(); @Input() public set showNotify(value: boolean) { let _showNotify: string = 'never'; if (value === true) { _showNotify = 'always'; } else { _showNotify = 'never'; } localStorage.setItem('BATCH_EDIT_DIALOG_SHOW_NOTIFY', _showNotify); } public get showNotify() { const _showNotify = localStorage.getItem('BATCH_EDIT_DIALOG_SHOW_NOTIFY'); if (_showNotify === 'always' || !_showNotify) { return true; } else { return false; } } constructor() { } ngOnInit() { } public cancel(event: any) { this.canceled.emit({ instance: this, event }); } public confirm(event: any) { this.confirmed.emit({ instance: this, event }); } public setRemindOpporunity(event: any) { const checked = event && event.target && event.target.checked || false; if (checked === true) { this.showNotify = false; } else { this.showNotify = true; } } }