﻿import { Component, ViewChild } from '@angular/core';
import { TfabricaSharedService } from './tfabrica.shared.service';
import { Subscription }   from 'rxjs/Subscription';

@Component({
    selector: 't-main',
    template: require('./tfabrica.main.component.html')
})
export class TfabricaMainComponent {

    @ViewChild('tleftmenu') tleftmenu;
    subscription: Subscription;

    constructor(
        private tfabricaSharedService: TfabricaSharedService
    ) {
        this.subscription = tfabricaSharedService.mainLeftSidenavToggled$.subscribe(
            toogle => {
                this.toggleSidenavMenu();
            }
        )
    }

    toggleSidenavMenu() {
        this.tleftmenu.toggle();
    }

}