mirror of https://github.com/abpframework/abp.git
2 changed files with 14 additions and 27 deletions
@ -1,33 +1,21 @@ |
|||
import { AuthService } from '@abp/ng.core'; |
|||
import { AuthService, RouterEvents } from '@abp/ng.core'; |
|||
import { Component } from '@angular/core'; |
|||
import { Router } from '@angular/router'; |
|||
import { Event, NavigationCancel, NavigationEnd, NavigationStart, Router } from '@angular/router'; |
|||
import { map } from 'rxjs'; |
|||
|
|||
@Component({ |
|||
selector: 'app-home', |
|||
templateUrl: './home.component.html', |
|||
}) |
|||
export class HomeComponent { |
|||
//for disabled button and abp loading spinner
|
|||
isLog: boolean = false; |
|||
loading: boolean = false; |
|||
get hasLoggedIn(): boolean { |
|||
return this.authService.isAuthenticated; |
|||
} |
|||
|
|||
constructor(private authService: AuthService, private router: Router) { |
|||
// this.router.events.subscribe(event => {
|
|||
// if (event instanceof NavigationStart) {
|
|||
// console.log(event);
|
|||
// }
|
|||
// });
|
|||
} |
|||
|
|||
constructor(private authService: AuthService) {} |
|||
login() { |
|||
//when clicked button spinner and disabled will be active
|
|||
this.isLog = true; |
|||
setTimeout(a => { |
|||
this.authService.navigateToLogin(); |
|||
//all functions is over here
|
|||
this.isLog = false; |
|||
}, 1000); |
|||
this.loading = true; |
|||
this.authService.navigateToLogin(); |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue