Skip to content
Loading
Angular Routing
  1.   
 
+2
  • Amit Kumar Singh

    Hi,

        this.service.login(1).subscribe(res=>{
          this.router.navigate(['home']);
    }); });

    Pls. check this one

    Thanks ! 

    +2
  • Hi,
     
    No it doesn't work. It does not redirect to the home page. This is due to why. 
    +2
  • Sachin Singh
    Does navigate work?
    1. passlogin(){         
    2.     
    3.     this.service.login(1).subscribe(res=>{      
    4.   this.router.navigate(['/home']);  
    5.     
    6.     });       
    7.   }    
    8.    
     
    +2