1 namespace app.directives {
3 export class HeaderMenu implements ng.IDirective {
5 public restrict: string;
6 public replace: boolean;
7 public templateUrl: string;
8 public controller: string;
9 public controllerAs: string;
10 public scope: boolean;
20 this.templateUrl = 'templates/header-menu.html';
21 this.controller = 'HeaderMenuController';
22 this.controllerAs = 'hmc';
28 * @returns {function(): HeaderMenu}
31 public static Factory(): ng.IDirectiveFactory {
32 var directive = () => {
33 return new HeaderMenu();
39 export class HeaderMenuController {
41 public static $inject = ['$state'];
43 private isExecution: boolean;
44 private isWorkspace: boolean;
45 private isHistory: boolean;
47 constructor(private $state: ng.ui.IStateService) {
48 this.isExecution = this.$state.current.name === 'execution';
49 this.isWorkspace = this.$state.current.name === 'workspace';
50 this.isHistory = this.$state.current.name === 'history';
53 private transit(state:string) {
54 this.$state.go(state);