0
The idea is to pass a phone number on the link to direct call on Whatsapp:
<a href="https://api.whatsapp.com/send?phone=+55'NUMERO'&text=blablabla">
Buttons and the like are already made, I just wonder how I put the variable that I already have where is 'NUMERO' up there.
I tried it this way
<a href="https://api.whatsapp.com/send?phone=+55NUMERO&text=blablabla" >
<button (click)= "troca(var)">
LINK
</button>
</a>
and no . ts (design being done with Angular) thus:
troca(n){
const link = document.querySelector('a');
link.href = link.href.replace('NUMERO', n);
}
I edited based on what you sent me, but I couldn’t, you know what might be going wrong yet?
– Vitor Ezequiel
I updated the answer
– Costamilam
It worked out, thanks.
– Vitor Ezequiel