All files / src/app/core/component base-child.component.ts

72.72% Statements 8/11
0% Branches 0/2
40% Functions 2/5
83.33% Lines 5/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2112x             12x   10x 10x     2x              
import { Directive, EventEmitter, Input, Output } from "@angular/core";
import { ComponentInputDomainData } from "@core/model/component-input-data.interface";
 
 
// abstract class used to handle common behaviour for components that may be used in modals
// or in regular child components
@Directive()
export abstract class BaseChildComponent {
  @Input({required: true}) data!: ComponentInputDomainData;
  @Output() succeeded = new EventEmitter<ComponentInputDomainData>();
  @Output() failed = new EventEmitter<ComponentInputDomainData>();
 
  success() :void {
    this.succeeded.emit(this.data);
  }
 
  fail() :void {
    this.failed.emit(this.data);
  }
}