import { MAT_DIALOG_DATA , MatDialogRef } from '@angular/material/dialog' ; import { Component , Inject } from '@angular/core' ; import { DataService } from '../../services/data.service' ; import { FormControl , Validators } from '@angular/forms' ; @ Component ( { selector : 'app-baza.dialog' , templateUrl : '../../dialogs/edit/edit.dialog.html' , styleUrls : [ '../../dialogs/edit/edit.dialog.css' ] } ) export class EditDialogComponent { constructor ( public dialogRef , @ Inject ( MAT_DIALOG_DATA ) public data , public dataService ) { } formControl = new FormControl ( '' , [ Validators . required ] ) ; getErrorMessage ( ) { return this . formControl . hasError ( 'required' ) ? 'Required field' : this . formControl . hasError ( 'email' ) ? 'Not a valid email' : '' ; } submit ( ) { } onNoClick ( ) { this . dialogRef . close ( ) ; } stopEdit ( ) { this . dataService . updateIssue ( this . data ) ; } }