Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda