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

28 lines
742 B
TypeScript
Raw Normal View History

///<reference path="../../browser.d.ts"/>
2016-04-27 02:30:25 +08:00
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'],
2016-05-01 16:28:05 +08:00
directives:[FrameComponent]
})
export class AdminComponent implements OnInit{
constructor(private _authService: AuthenticationService, private _router: Router) {
}
ngOnInit(){
if (!this._authService.isAuthenticated()) {
this._router.navigate(['Login']);
return;
}
}
}