import { Component, OnInit }      from '@angular/core';
import { Router }                 from '@angular/router';
import { TalleresService }        from './talleres.service'



@Component({
    selector: 'app-talleres',
    templateUrl: './talleres.component.html',
    styleUrls: ['./talleres.component.css'],
    providers: [TalleresService]
})



export class TalleresComponent implements OnInit {

    Talleres: string;


    constructor(
        private _TalleresService:       TalleresService,
        private router:                 Router
    )
    {   this._TalleresService.getTalleres()
            .subscribe(
                data  => this.Talleres  = data,
                error => alert(error)
            );
    }


    ngOnInit()
    {   if(!localStorage.getItem('currentUser'))
        

        else
        {   if( (localStorage.getItem('currentNacimiento')=='00/00/0000') || (localStorage.getItem('currentSexo')==''))
            {   this.router.navigate(['/editar/personales']);
            }
        }
    }

}
{   this.router.navigate(['/login']);
        }