Отключите JhiAlertService от использования TranslateService для перевода сообщения - PullRequest
0 голосов
/ 07 января 2020

Когда я использую свой сервис для печати сообщения, JhiAlertService пытается перевести сообщение, как я могу отключить?

enter image description here

import { Injectable } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { JhiAlertService } from 'ng-jhipster';

@Injectable({
    providedIn: 'root'
})
export class MessageServiceService {
    

    constructor(public translate: TranslateService, public alertService: JhiAlertService) {
        this.getTranslations();
    }
	
	getTranslations(){
		this.clientError1 = this.translate.instant('global.error.clientError1');
		this.clientError2 = this.translate.instant('global.error.clientError2');
	}

    printError(name, clientnumber) {
        this.alertService.error(
            this.clientError1 + name + this.clientError2 + clientnumber 
        );
    }
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...