Browse Source

modal

master
Florian Eisenmenger 2 years ago
parent
commit
64821a1447
2 changed files with 17 additions and 3 deletions
  1. +12
    -2
      matsen-tool/src/app/contacts/new-contact/new-contact.component.ts
  2. +5
    -1
      matsen-tool/src/app/partners/partners-detail/partners-detail.component.ts

+ 12
- 2
matsen-tool/src/app/contacts/new-contact/new-contact.component.ts View File

@@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import {Component, Input, OnInit} from '@angular/core';
import {FormGroup} 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 {ContactJsonld, ContactService} from "@app/core/api/v1";
@@ -9,7 +9,9 @@ import {Subscription} from "rxjs";
templateUrl: './new-contact.component.html', templateUrl: './new-contact.component.html',
styleUrl: './new-contact.component.scss' styleUrl: './new-contact.component.scss'
}) })
export class NewContactComponent {
export class NewContactComponent implements OnInit {
@Input() contactId: number | undefined;

protected contactForm: FormGroup; protected contactForm: FormGroup;
protected selectedImage: File | null; protected selectedImage: File | null;
protected contactSub: Subscription; protected contactSub: Subscription;
@@ -23,6 +25,14 @@ export class NewContactComponent {
this.contactSub = new Subscription(); this.contactSub = new Subscription();
} }


ngOnInit() {
console.log(this.contactId);
}

getData(meineId: any) {
console.log(meineId);
}

onSubmit() { onSubmit() {
if (this.contactForm.valid) { if (this.contactForm.valid) {
// Hier können Sie die Daten senden oder weitere Aktionen durchführen // Hier können Sie die Daten senden oder weitere Aktionen durchführen


+ 5
- 1
matsen-tool/src/app/partners/partners-detail/partners-detail.component.ts View File

@@ -95,7 +95,11 @@ export class PartnersDetailComponent implements OnInit, AfterViewInit {


openModalNewContact() { openModalNewContact() {
const modalRef = this.modalService.open(ModalComponent); const modalRef = this.modalService.open(ModalComponent);
modalRef.componentInstance.dynamicComponent = NewContactComponent;
const newContactComponentInstance = new NewContactComponent(this.contactService);
newContactComponentInstance.contactId = 3;
// const newContactComponentInstance = modalRef.componentInstance.dynamicComponent = new NewContactComponent(this.contactService);
//newContactComponentVar.getData(3);
modalRef.componentInstance.dynamicComponent = newContactComponentInstance;
} }


openModalNewPosting() { openModalNewPosting() {


Loading…
Cancel
Save