import { Component, EventEmitter, Input, Output } from '@angular/core';
import { HttpCancelService } from '@shared/services';

@Component({
    selector: 'page-loader',
    templateUrl: './page-loader.component.html',
})
export class PageLoaderComponent {
    @Input() canCancel = true;
    @Output() searchCancel: EventEmitter<any> = new EventEmitter<any>();

    constructor(private httpCancelService: HttpCancelService) {}

    handleClick() {
        this.httpCancelService.cancelPendingRequests();
        this.searchCancel.emit();
    }
}
