| @@ -14,7 +14,7 @@ | |||||
| </dl> | </dl> | ||||
| </div> | </div> | ||||
| <div class="col-4"> | <div class="col-4"> | ||||
| <img *ngIf="contact.imageUrl !== null" src="{{environment.basePath}}{{contact.imageUrl}}" width="247" | |||||
| <img *ngIf="contact.imageUrl !== null" src="{{contact.imageUrl}}" width="247" | |||||
| height="94" | height="94" | ||||
| alt="{{contact.firstName}} {{contact.lastName}}" title="{{contact.firstName}} {{contact.lastName}}"/> | alt="{{contact.firstName}} {{contact.lastName}}" title="{{contact.firstName}} {{contact.lastName}}"/> | ||||
| </div> | </div> | ||||
| @@ -1,6 +1,8 @@ | |||||
| import {Component} from '@angular/core'; | import {Component} from '@angular/core'; | ||||
| import {FormBuilder, FormGroup, Validators} from "@angular/forms"; | |||||
| import {FormGroup} from "@angular/forms"; | |||||
| import {contactForm} from "@app/_forms/apiForms"; | import {contactForm} from "@app/_forms/apiForms"; | ||||
| import {ContactJsonld, ContactService} from "@app/core/api/v1"; | |||||
| import {Subscription} from "rxjs"; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-new-contact', | selector: 'app-new-contact', | ||||
| @@ -10,11 +12,15 @@ import {contactForm} from "@app/_forms/apiForms"; | |||||
| export class NewContactComponent { | export class NewContactComponent { | ||||
| protected contactForm: FormGroup; | protected contactForm: FormGroup; | ||||
| protected selectedImage: File | null; | protected selectedImage: File | null; | ||||
| protected contactSub: Subscription; | |||||
| constructor( | constructor( | ||||
| private fb: FormBuilder | |||||
| private contactService: ContactService | |||||
| ) { | ) { | ||||
| this.contactForm = contactForm; | this.contactForm = contactForm; | ||||
| this.selectedImage = null; | this.selectedImage = null; | ||||
| this.contactSub = new Subscription(); | |||||
| } | } | ||||
| onSubmit() { | onSubmit() { | ||||
| @@ -22,6 +28,14 @@ export class NewContactComponent { | |||||
| // Hier können Sie die Daten senden oder weitere Aktionen durchführen | // Hier können Sie die Daten senden oder weitere Aktionen durchführen | ||||
| console.log(this.selectedImage); | console.log(this.selectedImage); | ||||
| console.log('Formular wurde gesendet:', this.contactForm.value); | console.log('Formular wurde gesendet:', this.contactForm.value); | ||||
| this.contactSub = this.contactService.contactsPost( | |||||
| this.contactForm.value as ContactJsonld | |||||
| ).subscribe( | |||||
| data => { | |||||
| console.log(data); | |||||
| } | |||||
| ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -25,7 +25,7 @@ | |||||
| </dl> | </dl> | ||||
| </div> | </div> | ||||
| <div class="col-4"> | <div class="col-4"> | ||||
| <img *ngIf="partner.logoUrl !== null" src="{{environment.basePath}}{{partner.logoUrl}}" width="247" | |||||
| <img *ngIf="partner.logoUrl !== null" src="{{partner.logoUrl}}" width="247" | |||||
| height="94" alt="{{partner.name}}" title="{{partner.name}}"/> | height="94" alt="{{partner.name}}" title="{{partner.name}}"/> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -46,7 +46,7 @@ | |||||
| {{ contact.position }}</p> | {{ contact.position }}</p> | ||||
| </div> | </div> | ||||
| <div class="col-4"> | <div class="col-4"> | ||||
| <img src="{{environment.basePath}}{{contact.imageUrl}}" width="247" height="94" | |||||
| <img src="{{contact.imageUrl}}" width="247" height="94" | |||||
| alt="{{contact.firstName}} {{contact.lastName}}" | alt="{{contact.firstName}} {{contact.lastName}}" | ||||
| title="{{contact.firstName}} {{contact.lastName}}"/> | title="{{contact.firstName}} {{contact.lastName}}"/> | ||||
| </div> | </div> | ||||
| @@ -154,7 +154,6 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit { | |||||
| this.id | this.id | ||||
| ).subscribe( | ).subscribe( | ||||
| data => { | data => { | ||||
| console.log(data); | |||||
| this.posts = data["hydra:member"]; | this.posts = data["hydra:member"]; | ||||
| this.postsLength = Number(data["hydra:totalItems"]); | this.postsLength = Number(data["hydra:totalItems"]); | ||||
| this.postsPaginator.length = this.postsLength; | this.postsPaginator.length = this.postsLength; | ||||
| @@ -147,8 +147,7 @@ export class PartnersComponent implements OnInit, AfterViewInit { | |||||
| navigateToPartnerDetails(element: any) { | navigateToPartnerDetails(element: any) { | ||||
| const partner: PartnerJsonld = element as PartnerJsonld; | const partner: PartnerJsonld = element as PartnerJsonld; | ||||
| console.log(partner.type); | |||||
| console.log(ApiConverter.extractId(partner.id)); | |||||
| // console.log(ApiConverter.extractId(partner.id)); | |||||
| this.router.navigate(['/' + partner.type, ApiConverter.extractId(partner.id)]); | this.router.navigate(['/' + partner.type, ApiConverter.extractId(partner.id)]); | ||||
| } | } | ||||