2016-04-26 21:10:05 +08:00
|
|
|
///<reference path="../../browser.d.ts"/>
|
|
|
|
|
2016-04-27 02:30:25 +08:00
|
|
|
import {Component, OnInit} from 'angular2/core';
|
2016-05-01 00:01:54 +08:00
|
|
|
import {AuthenticationService} from "../model/network/authentication.service.ts";
|
2016-04-26 21:10:05 +08:00
|
|
|
import {Router} from "angular2/router";
|
2016-04-27 02:30:25 +08:00
|
|
|
import {MATERIAL_DIRECTIVES} from "ng2-material/all";
|
|
|
|
import {MATERIAL_BROWSER_PROVIDERS} from "ng2-material/all";
|
2016-04-26 21:10:05 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|