Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

247
Views
Angular 2: "router.navigate" Error de codificación en la URL

Cuando envío un formulario, quiero navegar a otro sitio y establecer los valores de búsqueda en la URL como parámetros.

Tengo el siguiente código:

 searchOffers() { this.router.navigate([ '/search?query= + this.search.value.FG ]); }

Este código funciona, pero la URL se ve así después del enrutamiento.

 localhost:4200/search%3Fquery%3D1

(El valor del parámetro de query es 1).

Con esta URL no puedo obtener los parámetros.

¿Cómo puedo formatear la URL a esto: localhost:4200/search?query=1 ?

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

He tenido el caso en el que obtengo una cadena con la URL completa, incluidos los parámetros de consulta.

En este caso puedes hacer esto

 searchOffers() { this.router.navigateByUrl('/search?query= + this.search.value.FG); }
about 4 years ago · Santiago Trujillo Report

0

Hacer uso del parámetro de opciones:

 searchOffers() { this.router.navigate(['/search'], { queryParams: { query: this.search.value.FG } }); }
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!