I am looking to transmit abstract data (In Angular 4 or 5) from one component to another without it being visible in the url. Currently, I am using the following method:
let navigationExtras: NavigationExtras = {
queryParams: {
"firstname": "Nic",
"lastname": "Raboy"
}
};
this.router.navigate(['home-aluno/'+change.matricula], navigationExtras);
However, the presence of "Nic" and "Raboy" in the url is not ideal for my requirements.
Here is an example of the current url:
http://localhost:4200/home-aluno/001?firstname=Nic&lastname=Raboy
I am seeking a solution to send and receive the data in the other component (through navigation) without it being displayed in the url. Is there a way to achieve this using routes?