diff --git a/src/app/feed/feed.page.html b/src/app/feed/feed.page.html index 9c09003..d7246a7 100644 --- a/src/app/feed/feed.page.html +++ b/src/app/feed/feed.page.html @@ -6,6 +6,10 @@ + + + +
diff --git a/src/app/feed/feed.page.scss b/src/app/feed/feed.page.scss index e69de29..0bfacdd 100644 --- a/src/app/feed/feed.page.scss +++ b/src/app/feed/feed.page.scss @@ -0,0 +1,3 @@ +.searchbar{ + float: right; +} \ No newline at end of file diff --git a/src/app/feed/feed.page.ts b/src/app/feed/feed.page.ts index f928a9e..2eb9d5d 100644 --- a/src/app/feed/feed.page.ts +++ b/src/app/feed/feed.page.ts @@ -5,6 +5,7 @@ import { DiscotecaI } from '../interfaces/discoteca-i'; import { ApiService } from '../services/api.service'; import { FeedService } from '../services/feed.service'; import { Tab1Service } from '../tab1/tab1.service'; +import { EventListenerFocusTrapInertStrategy } from '@angular/cdk/a11y'; @Component({ selector: 'app-feed', @@ -16,9 +17,12 @@ export class FeedPage implements OnInit { eventos: Eventoi[]; discotecas: DiscotecaI[]; idsDiscoteca: number[]; + mostrarTodos: boolean; + constructor(private feedService:FeedService, private tab1Service: Tab1Service, private router:Router, private apiService: ApiService ) { } ngOnInit() { + this.mostrarTodos = true; this.eventos = this.feedService.eventos; this.idsDiscoteca = []; this.discotecas=[]; @@ -54,6 +58,26 @@ export class FeedPage implements OnInit { ) } + filtrarEventos(){ + var filtro = (document.getElementById("filtro")).value; + let eventoSinFiltrar = this.feedService.eventos; + this.eventos = []; + eventoSinFiltrar.forEach(evento => { + if (this.cumpleFiltro(evento, filtro)){ + this.eventos.push(evento); + } + }) + + } + + cumpleFiltro(evento: Eventoi, filtro: string){ + + if(evento.nombre.includes(filtro)){ + return true; + } + + else return false; + } }