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

171
Visualizações
How do I pass an i18n value to a function through a "click" event?

I can't provide much example code. I'm unable to paste the code I'm working with for reasons of confidentiality, and I'm too new to Angular to be able to produce a minimum working example.

I have a button with a click element and an i18n element:

<button type="button"
    (click)="myFunction('temporaryValue')"
    i18n="@@nonEnglishText">
        English Text
</button>

What I aim to do is replace temporaryValue in the click element with the value of i18n, but I don't know how to achieve this. I tried the following method, but it sends the string itself instead of the value it's supposed to refer to:

(click)="myFunction('@@nonEnglishText')"

I also tried the following method, but it doesn't work:

i18n-(click)="myFunction('@@nonEnglishText')"

How do I achieve sending the correct value to the function?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can't ,you have to translate the temporaryValue somewhere else , where do you store-it or how do you get the value ?

about 4 years ago · Juan Pablo Isaza 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