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

313
Visualizações
Best way to save data before directing to external page (and then fetch it when going back to my page)?

I have an angular application with a page with a form inside. In that page there is also a link to an external website. In the external website the user does something and then is directed back to my page.

I would like the data the user initially adds to my page's form to be saved so that when the user comes back from the external website, he will find the initial page with all the information he inserted.

The only solution that comes to mind is cookies/localStorage. So for example I would have to save all the data in the localStorage, go to the external website, come back to my page, and load the data from the localStorage.

Is that the only way or is there a better solution?

Thank you!

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

0

Retrieving Data from route

You could set your desired data in the route and retrieve it in your Angular application. For Example, you want to check whether or not your user has checked something once they have been redirected to the external website; all you need to do is set a query param and then check it once the user comes back to your original web application.

e.g.:

yourwebsite.com/home?hasSelected=true

And in your component, you can access it like below:

constructor(private readonly activatedRoute: ActivatedRoute) { }

ngOnInit() {
    this.param1 = this.activatedRoute.snapshot.paramMap.get('param1');
}

You can learn more about getting data from query params Here.

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