Utilizing Angular navigation, I have implemented a technique for passing data from one module to another within my application.
For example, let's say we have Module A with the route /A and Module B with the route /B. When my application first loads Module A, it fetches some information from a REST API. Then, when transitioning to Module B, I need to carry that information over. That's where Angular navigation comes into play:
this.router.navigate(['/B', {dataforB: JSON.stringify(A), userdata: JSON.stringify(A.user) }]);
This method of sharing data is convenient but may pose security risks. Are there alternative techniques in Angular for handling data that could provide better security than using local or session storage?