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

305
Visualizações
Im trying to calc my div width on Angular NgStyle with 2 variables with different units

I am trying to make a width: calc() but i want to make a substract of 2 variables with different units but it doesnt show expected output.

[ngStyle]="{ 'width': calc(notHedgedProgress + '%' - newPositionX + 'px') }"

NotHedgedProgress and NewPositionX are numbers

as you can see im trying to substract a '%' unit variable with a 'px' one.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Your variables has to be interpolated and the style rule must be in the form of a string:

[ngStyle]="{ 'width': 'calc(' + notHedgedProgress + '% - ' + newPositionX + 'px)' }"
over 4 years ago · Santiago Trujillo Relatório
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