mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-16 11:37:13 +02:00
28 lines
742 B
TypeScript
28 lines
742 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 {FrameComponent} from "../frame/frame.component";
|
|
|
|
@Component({
|
|
selector: 'admin',
|
|
templateUrl: 'app/admin/admin.component.html',
|
|
styleUrls:['app/admin/admin.component.css'],
|
|
directives:[FrameComponent]
|
|
})
|
|
export class AdminComponent implements OnInit{
|
|
constructor(private _authService: AuthenticationService, private _router: Router) {
|
|
}
|
|
|
|
ngOnInit(){
|
|
if (!this._authService.isAuthenticated()) {
|
|
this._router.navigate(['Login']);
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|