Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

192
Visualizações
How to store large object in html data attribute without jquery

I have an angular project I'm working on where I'm trying to store an object that's being populated from a server in an HTML data attribute. This object looks something like this:

{"decimalPlaces": "2", "soft": "false"}

I've seen other solutions on stack overflow but they use jquery and I can't use that here. What I would like to be able to do is just feed the entire object to one HTML data attribute rather than have one data attribute for every property in this object. I would like for it to look something like the below line, and then be able to pull out precise data as needed from the angular component.ts file:

data-everything="allData"

And NOT like this

data-decimals="allData.decimalPlaces"
data-soft="allData.soft"

Is this possible? Also I have tried JSON.stringify as suggested in other solutions as well, in addition to console.dir to see if I could pull any data out of this "allData" but neither helped.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda