diff --git a/src/components/create-modal/create-modal/create-modal.component.html b/src/components/create-modal/create-modal/create-modal.component.html
index 45660c2..5a7d0cc 100644
--- a/src/components/create-modal/create-modal/create-modal.component.html
+++ b/src/components/create-modal/create-modal/create-modal.component.html
@@ -3,5 +3,25 @@
diff --git a/src/components/create-modal/create-modal/create-modal.component.ts b/src/components/create-modal/create-modal/create-modal.component.ts
index 5811767..24931c2 100644
--- a/src/components/create-modal/create-modal/create-modal.component.ts
+++ b/src/components/create-modal/create-modal/create-modal.component.ts
@@ -1,16 +1,39 @@
import {Component, inject} from '@angular/core';
import {NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
+import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
@Component({
selector: 'app-create-modal',
- imports: [],
+ imports: [
+ ReactiveFormsModule
+ ],
templateUrl: './create-modal.component.html',
styleUrl: './create-modal.component.css'
})
export class CreateModalComponent {
private activeModal = inject(NgbActiveModal)
+ protected newShowForm: FormGroup
+
+ constructor() {
+ this.newShowForm = new FormGroup({
+ title: new FormControl("", Validators.required),
+ year: new FormControl("", [Validators.required, Validators.min(1900)]),
+ seasons: new FormControl("", [Validators.required, Validators.min(1)]),
+ description: new FormControl("", Validators.required)
+ })
+ }
protected dismiss() {
this.activeModal.dismiss()
}
+
+ protected formSubmitted(form: FormGroup) {
+ let show: {} = {
+ title: form.get("title")?.value,
+ year: form.get("year")?.value,
+ seasons: form.get("seasons")?.value,
+ description: form.get("description")?.value
+ }
+ console.log(show)
+ }
}