Moved to Angular 6.0
---- Pending * Table width for the points column in incentive * Linting * keyboard navigation where it was used earlier * can remove the unused totals calculated serverside in productledger * spinner and loading bars * Activate Guard for Employee Function tabs * Progress for Fingerprint uploads * deleted reconcile and receipe features as they were not being used * focus the right control on component load
This commit is contained in:
25
overlord/src/app/auth/logout/logout.component.spec.ts
Normal file
25
overlord/src/app/auth/logout/logout.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {LogoutComponent} from './logout.component';
|
||||
|
||||
describe('LogoutComponent', () => {
|
||||
let component: LogoutComponent;
|
||||
let fixture: ComponentFixture<LogoutComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [LogoutComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LogoutComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
25
overlord/src/app/auth/logout/logout.component.ts
Normal file
25
overlord/src/app/auth/logout/logout.component.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Router} from '@angular/router';
|
||||
import {AuthService} from '../auth.service';
|
||||
import {ToasterService} from '../../core/toaster.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-logout',
|
||||
template: ''
|
||||
})
|
||||
export class LogoutComponent implements OnInit {
|
||||
|
||||
constructor(private auth: AuthService, private router: Router, private toaster: ToasterService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.auth.logout().subscribe(
|
||||
(result) => {
|
||||
this.toaster.show('Success', 'Logged Out');
|
||||
this.router.navigateByUrl('/');
|
||||
},
|
||||
(error) => this.toaster.show('Danger', error.error)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user