import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Eventoi } from '../interfaces/eventoi';
import { FeedService } from '../services/feed.service';
import { Tab1Service } from '../tab1/tab1.service';

@Component({
  selector: 'app-feed',
  templateUrl: './feed.page.html',
  styleUrls: ['./feed.page.scss'],
})
export class FeedPage implements OnInit {

  eventos: Eventoi[];

  constructor(private feedService:FeedService, private tab1Service: Tab1Service, private router:Router ) { }

  ngOnInit() {
    this.eventos = this.feedService.eventos;
  }

  mostrarEvento(evento: Eventoi){
    this.feedService.eventoIndex = this.eventos.indexOf(evento);
    this.router.navigate(['/tabs/tab2/view-evento-cliente']);
  }

}
