Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
Implementación de una plantilla de mensaje en una cadena

Estoy trabajando en un proyecto angular en el que el HTML está incrustado en un dispositivo ... no en un navegador web tradicional de una computadora. De todos modos, necesito enviar un mecanismo de registro a un dispositivo host que actúa como una especie de servidor.

Tengo el servicio funcionando y está funcionando. Puedo enviar mensajes de ida y vuelta. Necesito hacer un registro estructurado y me preguntaba si ya hay paquetes disponibles en lugar de escribir los míos.

Así que algo como esto:

 JAVASCRIPT: export class LogEvent { constructor(logLevel: any, messageTemplate: string , exception? : any , args? : any[]) { this.Level = logLevel; this.MessageTemplate = messageTemplate; this.Exception = exception; if (args) this.Properties = [... args]; } toString() : string { //this is what i Need.. to convert props into strings embeded into the //MessageTemplate } } var someValue = 1234; var msgT = "A message {someValue}"; var event = LogEvent(verbose, msgT, null, someValue); var str = event.toString() // expected str to be 'A message 1234'

el paquete npm @messageformat/parser analizará la plantilla de mensaje pero no he visto un método para crear el mensaje con los valores insertados en la plantilla de mensaje.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!