All files / src/app/extensions/tacton/pages/configure/tacton-config-parameter tacton-config-parameter.component.ts

100% Statements 7/7
83.33% Branches 5/6
100% Functions 3/3
100% Lines 7/7

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 21 228x     8x 8x       8x     20x     7x       8x      
import { Component, Input } from '@angular/core';
import { Observable } from 'rxjs';
 
import { TactonFacade } from '../../../facades/tacton.facade';
import { TactonProductConfigurationParameter } from '../../../models/tacton-product-configuration/tacton-product-configuration.model';
 
// eslint-disable-next-line ish-custom-rules/use-component-change-detection
@Component({ template: '' })
export abstract class TactonConfigParameterComponent {
  @Input({ required: true }) parameter: TactonProductConfigurationParameter;
 
  constructor(protected facade: TactonFacade) {}
 
  change(value: string | EventTarget) {
    this.facade.commitValue(this.parameter, typeof value === 'string' ? value : (value as HTMLDataElement).value);
  }
 
  getImageUrl(picture: string): Observable<string> {
    return this.facade.getImageUrl$(picture);
  }
}