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

283
Vistas
How to hide some params in URL with AngularJS UI Router?

I wanted to define a route that received one mandatory param and another optional param that would be hidden in the URL. It would be something like:

http://www.myapp.com/viewingPodcast/4

and the hidden param still available but not shown in the URL.

I am using ng-href + $state.href to get the url. I also have looked at this answer and it's comments but I still couldn't get it to work with my version.

This is my state config


.state("viewingPodcast", {
          ...
          url: "/podcast/:id",
          controller: "podcastCtrl",
          templateUrl: ...,
          params: { zineId: null },
          data: {
           ...
          },
          resolve: {
            ...
          },
        })

And the $state.href:

...
$state.href("viewingPodcast", { id: content.id, zineId: content.zineId });
...

Both values (id and zineId) are not nulled when debugging the $state.href line. I tried, like mentioned in the comments of the answer above:

$state.href("viewingPodcast", { id: content.id, zineId: { zineId: content.zineId } });

but when entering the controller and checking the params (with $state.params.zineId) the value is null.

I don't know if I'm doing something wrong and I still can't comment to ask on the other answer so I'm stuck creating a new question.

Thanks in advance

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