import { Component, EventEmitter, Injector, ViewChild, Output, Input } from '@angular/core'; import { AppComponentBase } from '@shared/common/app-component-base'; import { ContactListDto } from '@shared/service-proxies/service-proxies'; import { ModalDirective } from 'ngx-bootstrap'; import { PrimengTableHelper } from 'shared/helpers/PrimengTableHelper'; import { finalize } from 'rxjs/operators'; import * as jquery from 'jquery'; import * as moment from 'moment'; @Component({ templateUrl: './view-contact-modal.component.html', selector: 'viewContactModal', }) export class ViewContactModalComponent extends AppComponentBase { @ViewChild('viewContact', {static: true }) modal: ModalDirective; active = false; hide: boolean = false; txtFilter: any; item: ContactListDto; fullName : string; address1 : string; address2 : string; city : string; state : string; country : string; postalCode: string; @Input('inputs') inputs: { locationId: number; loadDate: any; } = {}; constructor( injector: Injector, ) { super(injector); } ngOnInit(){ } show(item: ContactListDto) { console.log(item); this.item = item; this.fullName = item.firstName + " " + item.lastName; this.address1 = item.address.addressLine1; this.address2 = item.address.addressLine2; this.city = item.address.postalCode.city; this.state = item.address.postalCode.state; this.country = item.address.postalCode.country; this.postalCode = item.address.postalCode.value; this.active = true; this.modal.show(); } onShown(): void { $('.kt-select2').select2(); } close(): void { this.active = false; this.modal.hide(); } }