Click here to Skip to main content
15,886,780 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<button class="align-bottom"
                  routerLink="/structure/profile">View
                  profile</button>


I want the pass emp_no value to profile component here,
i dont want query string here.

What I have tried:

onreadmoreclick(empno)
  {
    this.router.navigate(['/structure/profile'],{ state: { nobj: (empno)}});
  }



in profile component reading it as below:
this.user=window.history.state.empno;


but on page refresh data is getting vanished.
Posted
Updated 23-Sep-21 2:45am

1 solution

Have you tried using the angular location wrapper for the state api?

Angular[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900