Components/delete-modal: reformat
This commit is contained in:
parent
093180f5b2
commit
d1fd09ab75
3 changed files with 75 additions and 69 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {DeleteModalComponent} from './delete-modal.component';
|
||||
import { DeleteModalComponent } from './delete-modal.component';
|
||||
|
||||
describe('DeleteModalComponent', () => {
|
||||
let component: DeleteModalComponent;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
import {Component, inject} from '@angular/core';
|
||||
import {NgbActiveModal, NgbCollapse} from '@ng-bootstrap/ng-bootstrap';
|
||||
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators} from '@angular/forms';
|
||||
import {
|
||||
FormControl,
|
||||
FormGroup,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
Validators
|
||||
} from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
selector: 'app-delete-modal',
|
||||
|
|
@ -21,16 +27,16 @@ export class DeleteModalComponent {
|
|||
|
||||
constructor() {
|
||||
this.confirmationForm = new FormGroup({
|
||||
name: new FormControl("", Validators.required)
|
||||
name: new FormControl("",Validators.required)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
deletePressed() {
|
||||
if (this.formHidden) {
|
||||
const regex = new RegExp(this.showName)
|
||||
const control = new FormControl("", [Validators.required, Validators.pattern(regex)])
|
||||
this.confirmationForm.setControl("name", control)
|
||||
if (this.formHidden) {
|
||||
this.formHidden = false;
|
||||
this.buttonDisabled = true;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue