1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/frontend/app/admin/admin.component.ts
Braun Patrik f9481c9f6e adding bootstrap to the project
Refactoring lightbox
2016-04-30 18:01:54 +02:00

31 lines
925 B
TypeScript

///<reference path="../../browser.d.ts"/>
import {Component, OnInit} from 'angular2/core';
import {AuthenticationService} from "../model/network/authentication.service.ts";
import {Router} from "angular2/router";
import {MATERIAL_DIRECTIVES} from "ng2-material/all";
import {MATERIAL_BROWSER_PROVIDERS} from "ng2-material/all";
import {FrameComponent} from "../frame/frame.component";
@Component({
selector: 'admin',
templateUrl: 'app/admin/admin.component.html',
styleUrls:['app/admin/admin.component.css'],
directives:[MATERIAL_DIRECTIVES, FrameComponent],
providers:[MATERIAL_BROWSER_PROVIDERS]
})
export class AdminComponent implements OnInit{
constructor(private _authService: AuthenticationService, private _router: Router) {
}
ngOnInit(){
if (!this._authService.isAuthenticated()) {
this._router.navigate(['Login']);
return;
}
}
}