* initial commit

This commit is contained in:
Danyi Dávid
2018-11-11 12:00:45 +01:00
commit 3a86fe09ab
174 changed files with 17197 additions and 0 deletions

View File

View File

@@ -0,0 +1,3 @@
<p>
home works!
</p>

View 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();
});
});

View 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']);
}
}
}