import { EventEmitter, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { ListComponent } from '../list/list.component'; import { CoreService } from '../../services'; export declare abstract class ListEditComponent extends ListComponent implements OnInit { /** * The parent model mostly has id. This can be string or number. */ id: string | number; /** * The parent model, that contains the V object. */ model: V; constructor(coreService: CoreService); /** * This event fires, when the parent model is loaded from the api successfully. */ protected afterModelLoaded: EventEmitter; /** * Private Initialize. */ ngOnInit(): void; /** * The abstract function, that needs to be implemented in the child element. This method will GET the V parent model from the api. * @returns Observable * @example public getModel(): Observable { return this.service.getById(+this.id); } */ protected abstract getModel(): Observable; /** * This method populates the parent model. * @param resp Succsessful response from the backend. */ private setModel; } export interface ListEditComponent { /** * This optional function runs before the afterModelLoaded event emitted. */ beforeModelLoaded(): void; }