Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

222
Vistas
JSON Object as string for @Input - Angular

I am having a component's html in which I have a property called info which is referred in a service file. The problem is info is a json string which will be parsed in the service (by angular). I have a scenario where one of the values of json contains a quote ('). The problem is I am unable to bypass the quote in html without running into a compilation error. Is there any solution for the same?

The following is an example snippet

<my-component id="wt_tab_206_000000010wrap" class="form-group  inlineblock"
                    [info]="{'id':'wt_tab_206_000000010','value':'LoadDatanew','disabled':false,'readonly':false}"
                    filterFields="N"></my-component>

In the above example, [info] is the property of concern. In that the value key is supposed to have the value like LoadData'new. But parsing it like LoadData\'new is not solving the problem. Any help is appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can pass the data as a object without stringifying it.

Just pass it like this:

<my-component id="wt_tab_206_000000010wrap" class="form-group inlineblock"
                    [info]="obj"
                    filterFields="N">
</my-component>

In your .ts file:

public obj = {
  id: 'wt_tab_206_000000010',
  value: 'LoadDatanew',
  disabled: false,
  readonly: false
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda