Skip to content

Commit 8a9d63b

Browse files
committed
chore(navigation): navigation fixed
1 parent 4fdaabe commit 8a9d63b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/home/home.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class Home {
2828

2929
logout() {
3030
localStorage.removeItem('jwt');
31-
this.router.parent.navigate(['/login']);
31+
this.router.parent.navigateByUrl('/login');
3232
}
3333

3434
callAnonymousApi() {

src/login/login.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export class Login {
3131
})
3232
.then(status)
3333
.then(json)
34-
.then((response) => {
34+
.then((response:any) => {
3535
localStorage.setItem('jwt', response.id_token);
36-
this.router.parent.navigate(['/home']);
36+
this.router.parent.navigateByUrl('/home');
3737
})
3838
.catch((error) => {
3939
alert(error.message);
@@ -43,6 +43,6 @@ export class Login {
4343

4444
signup(event) {
4545
event.preventDefault();
46-
this.router.parent.navigate(['/signup']);
46+
this.router.parent.navigateByUrl('/signup');
4747
}
4848
}

src/signup/signup.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export class Signup {
3131
})
3232
.then(status)
3333
.then(json)
34-
.then((response) => {
34+
.then((response:any) => {
3535
localStorage.setItem('jwt', response.id_token);
36-
this.router.navigate(['/home']);
36+
this.router.navigateByUrl('/home');
3737
})
3838
.catch((error) => {
3939
alert(error.message);
@@ -43,7 +43,7 @@ export class Signup {
4343

4444
login(event) {
4545
event.preventDefault();
46-
this.router.parent.navigate(['/login']);
46+
this.router.parent.navigateByUrl('/login');
4747
}
4848

4949
}

0 commit comments

Comments
 (0)