import { Component, Injector, ViewChild, ViewEncapsulation, OnInit, DoCheck, Input } from '@angular/core'; import { appModuleAnimation } from '@shared/animations/routerTransition'; import { AppComponentBase } from '@shared/common/app-component-base'; import { OrderStatusAttachmentServiceProxy } from '@shared/service-proxies/service-proxies'; import { LazyLoadEvent } from 'primeng/components/common/lazyloadevent'; import { Paginator } from 'primeng/components/paginator/paginator'; import { Table } from 'primeng/components/table/table'; import { finalize } from 'rxjs/operators'; import { ModalDirective } from 'ngx-bootstrap'; import { ActivatedRoute, Router } from '@angular/router'; import * as moment from 'moment'; import { DomSanitizer } from '@angular/platform-browser'; @Component({ templateUrl: './order-attachments.component.html', encapsulation: ViewEncapsulation.None, animations: [appModuleAnimation()], styleUrls: ['./order-detail.component.less'], selector: 'orderAttachment' }) export class OrderAttachment extends AppComponentBase implements OnInit { active = false; saving= false; orderId:number; image:string; caption:string; @ViewChild('orderAttachmentModal', {static: false}) modal: ModalDirective; constructor( injector: Injector, private id:ActivatedRoute, private _attachmentService:OrderStatusAttachmentServiceProxy, public sanitizer:DomSanitizer ) { super(injector); } ngOnInit() { this.id.paramMap.subscribe(params => { this.orderId = Number(params.get('id')); }); } show(image:string,caption:string):void { this.image = image; this.caption = caption; this.active = true; this.modal.show(); } onShown(): void { } close(): void { this.active = false; this.modal.hide(); } }