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 { Component } from '@angular/core'; |
||||
import { Router } from '@angular/router'; |
import { Event, NavigationCancel, NavigationEnd, NavigationStart, Router } from '@angular/router'; |
||||
|
import { map } from 'rxjs'; |
||||
|
|
||||
@Component({ |
@Component({ |
||||
selector: 'app-home', |
selector: 'app-home', |
||||
templateUrl: './home.component.html', |
templateUrl: './home.component.html', |
||||
}) |
}) |
||||
export class HomeComponent { |
export class HomeComponent { |
||||
//for disabled button and abp loading spinner
|
loading: boolean = false; |
||||
isLog: boolean = false; |
|
||||
get hasLoggedIn(): boolean { |
get hasLoggedIn(): boolean { |
||||
return this.authService.isAuthenticated; |
return this.authService.isAuthenticated; |
||||
} |
} |
||||
|
|
||||
constructor(private authService: AuthService, private router: Router) { |
constructor(private authService: AuthService) {} |
||||
// this.router.events.subscribe(event => {
|
|
||||
// if (event instanceof NavigationStart) {
|
|
||||
// console.log(event);
|
|
||||
// }
|
|
||||
// });
|
|
||||
} |
|
||||
|
|
||||
login() { |
login() { |
||||
//when clicked button spinner and disabled will be active
|
this.loading = true; |
||||
this.isLog = true; |
this.authService.navigateToLogin(); |
||||
setTimeout(a => { |
|
||||
this.authService.navigateToLogin(); |
|
||||
//all functions is over here
|
|
||||
this.isLog = false; |
|
||||
}, 1000); |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue