import { Component } from '@angular/core';
import { AppConstants } from '../shared/app.constants';
import { WorkspaceService } from '../workspace';

@Component({
    selector: 'title-bar',
    templateUrl: 'title-bar.html',
    styleUrls: ['./title-bar.css']
})

export class TitleBarComponent {
    public showElement: boolean = true;
    projects: Array<any> = new Array<any>();
    len: any;
    /*
    *    Title bar constructor
    ***************************************************************/
    constructor(private workspaceService: WorkspaceService) {

        this.workspaceService.projects.subscribe((project: any) => {
            this.projects.push(project.project);
            this.len = this.projects.length;
            if (this.len > 0)
                this.showElement = false;

        });

    }
}