I'm trying to use the getDeep() function in Angular. I have already used it elsewhere in my code but in this particular part of the code it causes a TypeError. I would really appreciate it if someone can shed a light on why this is not working.
import { ConfigStateBase } from './config-state-base';
import { Injector } from '@angular/core';
import { ConfigStateService } from '@abp/ng.core';
export class RuleOutputState extends ConfigStateBase {
public readonly id: string;
public readonly value: string;
public readonly label: string;
public readonly imageUrl?: string;
public readonly fullImageUrl?: string;
public readonly position: number;
private readonly config: ConfigStateService;
constructor(injector: Injector, ruleOutputExport: any) {
super(injector);
this.id = ruleOutputExport.id;
this.value = ruleOutputExport.value;
this.label = this.translatorService.getLabel(ruleOutputExport.labels, this.value);
this.imageUrl = this.translatorService.getLabel(ruleOutputExport.images);
console.log(this.imageUrl);
this.fullImageUrl = this.createFullImageUrl(this.imageUrl);
console.log(this.fullImageUrl);
this.position = ruleOutputExport.position;
}
protected createFullImageUrl(imageUrl?: string): string {
if (!imageUrl) {
return null;
}
else {
return `${this.config.getDeep('environment.application.questionImagesUrl')}/${imageUrl}`;
}
}
}