import { Component, EventEmitter, Input, Output, SimpleChanges } from '@angular/core'; @Component({ selector: 'rss-create-dialog', templateUrl: './create-dialog.component.html', styleUrls: ['./create-dialog.component.scss'] }) export class CreateDialogComponent { @Input('createDialogConfig') dialogConfig: any; @Output() onDialogAdd: EventEmitter = new EventEmitter(); public showCreateDialogControl: boolean = false; public newDialogdata: string; public showCreateDialog() { this.dialogConfig.close = false; this.showCreateDialogControl = true; this.newDialogdata = ""; this.dialogConfig.errorMessage=undefined; } public hideCreateDialog() { this.dialogConfig.errorMessage=undefined; this.showCreateDialogControl = false; } public addDialogData = () => { this.dialogConfig.errorMessage = ""; this.onDialogAdd.emit(this.newDialogdata); } public isFormValid() { if (this.newDialogdata && this.newDialogdata.trim().length > 0) return true; else return false; } }