|
|
|
@@ -1,6 +1,8 @@ |
|
|
|
import {Component} from '@angular/core'; |
|
|
|
import {FormBuilder, FormGroup, Validators} from "@angular/forms"; |
|
|
|
import {FormGroup} from "@angular/forms"; |
|
|
|
import {contactForm} from "@app/_forms/apiForms"; |
|
|
|
import {ContactJsonld, ContactService} from "@app/core/api/v1"; |
|
|
|
import {Subscription} from "rxjs"; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'app-new-contact', |
|
|
|
@@ -10,11 +12,15 @@ import {contactForm} from "@app/_forms/apiForms"; |
|
|
|
export class NewContactComponent { |
|
|
|
protected contactForm: FormGroup; |
|
|
|
protected selectedImage: File | null; |
|
|
|
protected contactSub: Subscription; |
|
|
|
|
|
|
|
constructor( |
|
|
|
private fb: FormBuilder |
|
|
|
private contactService: ContactService |
|
|
|
) { |
|
|
|
this.contactForm = contactForm; |
|
|
|
this.selectedImage = null; |
|
|
|
|
|
|
|
this.contactSub = new Subscription(); |
|
|
|
} |
|
|
|
|
|
|
|
onSubmit() { |
|
|
|
@@ -22,6 +28,14 @@ export class NewContactComponent { |
|
|
|
// Hier können Sie die Daten senden oder weitere Aktionen durchführen |
|
|
|
console.log(this.selectedImage); |
|
|
|
console.log('Formular wurde gesendet:', this.contactForm.value); |
|
|
|
|
|
|
|
this.contactSub = this.contactService.contactsPost( |
|
|
|
this.contactForm.value as ContactJsonld |
|
|
|
).subscribe( |
|
|
|
data => { |
|
|
|
console.log(data); |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|