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

146
Visualizações
Modify URL on copy (-paste)

I need to modify the url on copy from an angular project.

When the user selects URL and copy (like ctrl+c), it is

page/item/123

I need to modify that to

page/item?id=123

How can I do that?

Reason: I could not make the web.config work to pass the full path (item/123), so angular cannot parse what is not there.

However, I can make item?id=.... work, so it opens "item" and there I can get the query parameter.

Added: in the comments it was suggested to do it one way/the right way only and I agree - but I am here because my original problem cannot be solved: web.config - forward full path with parameter

How to make rules work with parameters and pass the full path for parsing

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

0

Here's how it can be done:

html

<div (copy)="handleCopy($event)">page/item/1234</div>

ts

handleCopy(event: ClipboardEvent) {
  event.clipboardData.setData('text/plain', 
  document.getSelection().toString().replace(/\/(?=[^\/]*$)/, "?id="));
  event.preventDefault();
}
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