In a particular scenario, I am faced with the need to combine two error messages - one from a backend response and the other being a localized and translated text.
The code snippet in question is as follows:
this.globalMessageService.add(
{ key: 'httpHandlers.internalServerError.exception'},
// errors[0].message,
GlobalMessageType.MSG_TYPE_ERROR
);
The issue I am encountering is the difficulty in merging the errors[0].message
string with the localized text. When using the +
operator, the value
from the current key
is converted to a string, resulting in the localized text not being displayed.
I am open to any suggestions or advice on how to approach this problem!