import {Component, OnInit} from '@angular/core'; import {FieldWrapper} from '@ngx-formly/core'; @Component({ selector: 'jhi-wrapper-label-html', templateUrl: './wrapper-label-html.component.html', styleUrls: ['./wrapper-label-html.component.scss'] }) export class WrapperLabelHtmlComponent extends FieldWrapper implements OnInit { constructor() { super(); } ngOnInit(): void { this.replaceByModelValue(); } replaceByModelValue(): void { const label = this.field.templateOptions.label; const reg = /\$_\[(.*?)\]/g; let m; do { m = reg.exec(label); if (m) { this.field.templateOptions.label = this.field.templateOptions.label.replace('$_[' + m[1] + ']', this.model[m[1]]); } } while (m); } }