import { EventEmitter, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { BaseComponent } from '../base/base.component'; export declare abstract class ShowComponent extends BaseComponent implements OnInit { /** * The model mostly has id. This can be string or number. */ id: string | number; /** * The model, that contains the T object. */ model: T; /** * This event fires, when the model is loaded from the api successfully. */ protected afterModelLoaded: EventEmitter; /** * Error flag. */ private error; /** * Private Initialize. */ ngOnInit(): void; readonly hasError: boolean; /** * The abstract function, that needs to be implemented in the child element. This method will GET the T model from the api. * @returns Observable * @example public getModel(): Observable { return this.service.getById(+this.id); } */ protected abstract getModel(): Observable; /** * This method repopulates the model and the originalModel. This method uses the loading feature, and loads the model from the backend. */ protected reloadModel(): void; /** * This method populates the model and the originalModel. * @param resp Succsessful response from the backend. */ private setModel; /** * Simple error handler. * @param {any} error Error */ private errorHandler; } export interface ShowComponent { /** * This optional function runs before the afterModelLoaded event emitted. */ beforeModelLoaded(): void; onError(): void; }