You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 lines
799 B

import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AccountService } from 'src/app/service/account.service';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
uid!:any;
constructor(private accountService : AccountService, private route: Router) { }
ngOnInit(): void {
this.accountService.getDetails(window.sessionStorage.getItem("username")).subscribe(data =>{
window.sessionStorage.setItem('userid',String(data.id));
console.log("home")
});
}
onAccount(){
this.uid = window.sessionStorage.getItem('userid');
this.route.navigateByUrl('/account/'+this.uid);
console.log("get by id")
}
}