import { Component, ViewChild, Injector, Output, EventEmitter } from '@angular/core'; import { ModalDirective } from 'ngx-bootstrap'; import { ControllerRouteServiceProxy } from '@shared/service-proxies/service-proxies'; import { AppComponentBase } from '@shared/common/app-component-base'; @Component({ selector: 'unfreezeModal', templateUrl: './unfreeze-modal.component.html' }) export class UnfreezeModalComponent extends AppComponentBase { @ViewChild('createOrEditModal', { static: true }) modal: ModalDirective; @Output() modalSave: EventEmitter = new EventEmitter(); active = false; saving = false; reason: any; routeId: any; routeCode: any; adjustment: any; //item: GetRouteStopForViewDto; constructor( injector: Injector, private _controllerRouteService: ControllerRouteServiceProxy, ) { super(injector); } show(routeId, routeCode): void { this.routeId = routeId; this.routeCode = routeCode; this.active = true; this.modal.show(); } close(): void { this.active = false; this.modal.hide(); } save(): void { this.saving = true; this._controllerRouteService.unfreeze( this.reason, this.routeId, this.routeCode, this.adjustment ).pipe().subscribe(result => { this.notify.info(this.l('SavedSuccessfully')); this.modalSave.emit(null); this.close(); }); } }