Commit 1d37dc9c authored by prumde's avatar prumde

Redirect to home after log-out


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174483 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d779a68f
......@@ -3,6 +3,7 @@ import { ECMSigninService } from '../ecm-signin/ecm-signin.service';
import { EcmCartService } from '../ecm-view/ecm-cart/ecm-cart.service';
import { EcmLocationService } from '../ecm-search/ecm-location.service';
import { FormGroupDirective, NgControl, NgForm, NgModel } from '@angular/forms';
import { ActivatedRoute, Router,ActivatedRouteSnapshot,RoutesRecognized } from '@angular/router';
import { Store } from '@ngrx/store';
import { AppState } from '../ecm-store/reducers';
......@@ -38,7 +39,7 @@ export class EcmUserOptionComponent implements OnInit {
_confirm_password: string;
timer : any;
constructor( public signinService: ECMSigninService, private store: Store<AppState>, public cartService: EcmCartService, private cartAction: CartActions, private locationService: EcmLocationService) { }
constructor( public signinService: ECMSigninService, private store: Store<AppState>, public cartService: EcmCartService, private cartAction: CartActions, private locationService: EcmLocationService, private route: ActivatedRoute, private router: Router) { }
ngOnInit() {
var userInfo = localStorage.getItem( 'userInfo' );
......@@ -118,6 +119,12 @@ export class EcmUserOptionComponent implements OnInit {
else if ( result.Response.status == 'error' ) {
this.userData = null;
}
let openRoutePath = this.route.snapshot.url[0].path;
if(openRoutePath !== 'home')
{
this.router.navigate(['/home']);
}
},
error => {
let errorMessage = <any>error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment