import { Component, OnInit } from '@angular/core';
import { DiscotecaI } from '../interfaces/discoteca-i';
import { Eventoi } from '../interfaces/eventoi';
import { FeedService } from '../services/feed.service';

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

  discoteca: DiscotecaI
  eventos: Eventoi[]

  constructor(private feedService: FeedService) { }

  ngOnInit() {
    this.eventos = [];
    this.discoteca = this.feedService.discotecaEvento;
    this.feedService.eventos.forEach(evento => {
      if (this.discoteca.discotecaID == evento.discotecaID){
        this.eventos.push(evento);
      }
    })
  }

}
