* initial commit
This commit is contained in:
0
src/app/home/home.component.css
Normal file
0
src/app/home/home.component.css
Normal file
3
src/app/home/home.component.html
Normal file
3
src/app/home/home.component.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<p>
|
||||
home works!
|
||||
</p>
|
||||
25
src/app/home/home.component.spec.ts
Normal file
25
src/app/home/home.component.spec.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { HomeComponent } from './home.component';
|
||||
|
||||
describe('HomeComponent', () => {
|
||||
let component: HomeComponent;
|
||||
let fixture: ComponentFixture<HomeComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ HomeComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(HomeComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
25
src/app/home/home.component.ts
Normal file
25
src/app/home/home.component.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AuthService } from "../auth/auth.service";
|
||||
import { Router } from "@angular/router";
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
templateUrl: './home.component.html',
|
||||
styleUrls: ['./home.component.css']
|
||||
})
|
||||
export class HomeComponent implements OnInit {
|
||||
|
||||
constructor(private authService: AuthService,
|
||||
private router: Router) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
let roles = this.authService.tokenData.roles;
|
||||
if (roles.indexOf('betekinto') != -1) {
|
||||
this.router.navigate(['/hiba/lista']);
|
||||
} else {
|
||||
this.router.navigate(['/hiba/feladat-lista']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user