| @@ -1,10 +0,0 @@ | |||||
| <div class="modal-header"> | |||||
| <!-- <h4 class="modal-title">Hi there!</h4>--> | |||||
| <button type="button" class="btn-close" aria-label="Close" (click)="activeModal.dismiss('Cross click')"></button> | |||||
| </div> | |||||
| <div class="modal-body"> | |||||
| <ng-container *ngComponentOutlet="dynamicComponent; inputs: inputData"></ng-container> | |||||
| </div> | |||||
| <div class="modal-footer"> | |||||
| <button type="button" class="btn btn-outline-dark" (click)="activeModal.close('Close click')">Close</button> | |||||
| </div> | |||||
| @@ -1,23 +0,0 @@ | |||||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
| import { ModalComponent } from './modal.component'; | |||||
| describe('ModalComponent', () => { | |||||
| let component: ModalComponent; | |||||
| let fixture: ComponentFixture<ModalComponent>; | |||||
| beforeEach(async () => { | |||||
| await TestBed.configureTestingModule({ | |||||
| declarations: [ModalComponent] | |||||
| }) | |||||
| .compileComponents(); | |||||
| fixture = TestBed.createComponent(ModalComponent); | |||||
| component = fixture.componentInstance; | |||||
| fixture.detectChanges(); | |||||
| }); | |||||
| it('should create', () => { | |||||
| expect(component).toBeTruthy(); | |||||
| }); | |||||
| }); | |||||
| @@ -1,38 +0,0 @@ | |||||
| import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; | |||||
| import {NgbActiveModal} from "@ng-bootstrap/ng-bootstrap"; | |||||
| @Component({ | |||||
| selector: 'app-modal', | |||||
| templateUrl: './modal.component.html', | |||||
| styleUrl: './modal.component.scss', | |||||
| }) | |||||
| export class ModalComponent implements OnInit { | |||||
| @Input() dynamicComponent: any; | |||||
| @Input() inputData: any; | |||||
| @Output() public submit: EventEmitter<any> = new EventEmitter<any>(); | |||||
| constructor(public activeModal: NgbActiveModal) { | |||||
| } | |||||
| ngOnInit(): void { | |||||
| // this.submit.emit("flo is toll"); | |||||
| // this.dynamicComponent.submit.subscribe(() => { | |||||
| // console.log('Ereignis von dynamischer Komponente empfangen'); | |||||
| // // Hier kannst du die Logik für das Abfangen des Ereignisses implementieren | |||||
| // }); | |||||
| } | |||||
| onSubmit() { | |||||
| console.log("FLOR"); | |||||
| } | |||||
| onChildSubmit($event: any) { | |||||
| this.submit.emit($event); | |||||
| } | |||||
| public static createInputData(inputData: any) { | |||||
| return { 'inputData': inputData } | |||||
| } | |||||
| } | |||||
| @@ -25,7 +25,6 @@ import {PartnersDetailComponent} from './partners/partners-detail/partners-detai | |||||
| import {NewContactComponent} from './contacts/new-contact/new-contact.component'; | import {NewContactComponent} from './contacts/new-contact/new-contact.component'; | ||||
| import {ContactsComponent} from './contacts/contacts.component'; | import {ContactsComponent} from './contacts/contacts.component'; | ||||
| import {ContactsDetailComponent} from './contacts/contacts-detail/contacts-detail.component'; | import {ContactsDetailComponent} from './contacts/contacts-detail/contacts-detail.component'; | ||||
| import {ModalComponent} from './_components/modal/modal.component'; | |||||
| import {PropertyInterceptor} from "@app/_helpers/property.interceptor"; | import {PropertyInterceptor} from "@app/_helpers/property.interceptor"; | ||||
| import {MatPaginatorModule} from "@angular/material/paginator"; | import {MatPaginatorModule} from "@angular/material/paginator"; | ||||
| import {MatSortModule} from "@angular/material/sort"; | import {MatSortModule} from "@angular/material/sort"; | ||||
| @@ -93,7 +92,6 @@ export function HttpLoaderFactory(http: HttpClient) { | |||||
| HomeComponent, | HomeComponent, | ||||
| TwoColumnComponent, | TwoColumnComponent, | ||||
| ProductsDetailComponent, | ProductsDetailComponent, | ||||
| ModalComponent, | |||||
| PartnersDetailComponent, | PartnersDetailComponent, | ||||
| NewContactComponent, | NewContactComponent, | ||||
| ContactsComponent, | ContactsComponent, | ||||
| @@ -7,11 +7,9 @@ import {Router, RouterLink, RouterLinkActive} from "@angular/router"; | |||||
| import {MatTableDataSource, MatTableModule} from "@angular/material/table"; | import {MatTableDataSource, MatTableModule} from "@angular/material/table"; | ||||
| import {OrderFilter} from "@app/_models/orderFilter"; | import {OrderFilter} from "@app/_models/orderFilter"; | ||||
| import {NgIf} from "@angular/common"; | import {NgIf} from "@angular/common"; | ||||
| import {ModalComponent} from "@app/_components/modal/modal.component"; | |||||
| import {NgbModal, NgbModalOptions} from "@ng-bootstrap/ng-bootstrap"; | import {NgbModal, NgbModalOptions} from "@ng-bootstrap/ng-bootstrap"; | ||||
| import {NewDocumentComponent} from "@app/documents/new-document/new-document.component"; | import {NewDocumentComponent} from "@app/documents/new-document/new-document.component"; | ||||
| import {TranslateModule} from "@ngx-translate/core"; | import {TranslateModule} from "@ngx-translate/core"; | ||||
| import {NewProductComponent} from "@app/products/new-product/new-product.component"; | |||||
| import {ModalStatus} from "@app/_helpers/modal.states"; | import {ModalStatus} from "@app/_helpers/modal.states"; | ||||
| @Component({ | @Component({ | ||||