File

libs/ngx-pfe/pfe-service-activator/get-value/get-value.service.ts

Index

Properties

Constructor

constructor()

Properties

Public getValueByExpression
Type : function
import { inject, Injectable } from '@angular/core';
import { PfeModuleConfigurationService } from '../../services/pfe-module-configuration/pfe-module-configuration.service';
import { UnknownObject } from '../../models/unknown-object.model';
import { PfeUtilService } from './../../pfe-util/services/util.service';

@Injectable()
export class PfeServiceActivatorGetValueService {
  private pfeModuleConfigurationService = inject(PfeModuleConfigurationService);

  public getValueByExpression: (obj: UnknownObject, p: string) => unknown;

  constructor() {
    const ignoreEmptyArrays = this.pfeModuleConfigurationService.pfeModuleConfig().ignoreEmptyArraysInServiceActivatorPayloads ?? false;
    if (ignoreEmptyArrays) {
      this.getValueByExpression = (o, p) => PfeUtilService.getValueOrList(o, p, true);
    } else {
      this.getValueByExpression = (o, p) => PfeUtilService.getValueOrList(o, p);
    }
  }
}

results matching ""

    No results matching ""