There is a session variable called session
in my home.component.ts
. I need to access this variable in both user.compnent.ts
and dashboard.component.ts
. This is how the session variable is defined in home.component.ts
:
var session = sessionStorage.getItem('session');
Here is the code snippet from user.component.ts
:
import { HomeComponent } from '../Components/home.component';
constructor(private fb: FormBuilder, private _userService: UserService,
private _HomeComponent: HomeComponent, private router: Router) { }
However, I am unable to retrieve the session. I am still learning about Angular
.