Commit 0bc7ec18 by Luciano Barletta

busqueda component added

1 parent d7e9a93b
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { EspectaculosComponent } from './espectaculos/espectaculos.component';
import { InformacionComponent } from './informacion/informacion.component'; import { InformacionComponent } from './informacion/informacion.component';
import { MainComponent } from './main/main.component'; import { MainComponent } from './main/main.component';
import { BusquedaComponent } from './busqueda/busqueda.component';
const routes: Routes = [ const routes: Routes = [
{ path: '', component : MainComponent }, { path: '', component : MainComponent },
{ path: 'espectaculos', component: EspectaculosComponent }, { path: 'informacion/:id', component: InformacionComponent },
{ path: 'informacion/:id', component: InformacionComponent } { path: 'busqueda', component: BusquedaComponent }
]; ];
/* { path: '**', component: PageNotFoundComponent } */ /* { path: '**', component: PageNotFoundComponent } */
......
...@@ -3,26 +3,27 @@ import { NgModule } from '@angular/core'; ...@@ -3,26 +3,27 @@ import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { EspectaculosComponent } from './espectaculos/espectaculos.component';
import { FooterBarComponent } from './footer-bar/footer-bar.component'; import { FooterBarComponent } from './footer-bar/footer-bar.component';
import { MainComponent } from './main/main.component'; import { MainComponent } from './main/main.component';
import { NavBarComponent } from './nav-bar/nav-bar.component'; import { NavBarComponent } from './nav-bar/nav-bar.component';
import { InformacionComponent } from './informacion/informacion.component'; import { InformacionComponent } from './informacion/informacion.component';
import { ImagesService } from './services/images.service';
import { BusquedaComponent } from './busqueda/busqueda.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, AppComponent,
EspectaculosComponent,
FooterBarComponent, FooterBarComponent,
MainComponent, MainComponent,
NavBarComponent, NavBarComponent,
InformacionComponent InformacionComponent,
BusquedaComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
AppRoutingModule AppRoutingModule
], ],
providers: [], providers: [ImagesService],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
export class AppModule { } export class AppModule { }
<h1>Resultados de búsqueda</h1>
<button (click)="change()">
Ordenar {{ order }}
</button>
<!-- Esta es la card de resultado -->
<div *ngFor="let i of results" class="class-thingy">
{{ i }}
</div>
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EspectaculosComponent } from './espectaculos.component'; import { BusquedaComponent } from './busqueda.component';
describe('EspectaculosComponent', () => { describe('BusquedaComponent', () => {
let component: EspectaculosComponent; let component: BusquedaComponent;
let fixture: ComponentFixture<EspectaculosComponent>; let fixture: ComponentFixture<BusquedaComponent>;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [EspectaculosComponent] declarations: [ BusquedaComponent ]
}) })
.compileComponents(); .compileComponents();
})); }));
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(EspectaculosComponent); fixture = TestBed.createComponent(BusquedaComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });
......
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-busqueda',
templateUrl: './busqueda.component.html',
styleUrls: ['./busqueda.component.css']
})
export class BusquedaComponent implements OnInit {
order : string = "Asc";
results : any[];
constructor() { }
ngOnInit(): void {
this.results = [
"cosa1",
"cosa2",
"cosa3",
"cosa4",
"cosa5",
"cosa6",
"cosa7"
]
}
change() {
this.order == "Asc" ? "Des" : "Asc";
}
}
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'espectaculos',
templateUrl: './espectaculos.component.html',
styleUrls: ['./espectaculos.component.css']
})
export class EspectaculosComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</a> </a>
</svg> </svg>
<svg width="70" height="75"> <svg width="70" height="75">
<a *ngif onclick="openCity(event, 'Duracion')"> <a href="#" onclick="openCity(event, 'Duracion')">
<polygon points="0,0 0,75 25,50 50,75 50,0" class="Boton" /> <polygon points="0,0 0,75 25,50 50,75 50,0" class="Boton" />
<image xlink:href="assets/images/Tiempo.png" <image xlink:href="assets/images/Tiempo.png"
x="5" y="5" height="40px" width="40px"></image> x="5" y="5" height="40px" width="40px"></image>
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { ImagesService } from 'src/app/services/images.service'; import { ImagesService } from 'src/app/services/images.service';
import { AppRoutingModule } from 'src/app/app-routing.module';
@Component({ @Component({
selector: 'main', selector: 'main',
...@@ -29,8 +28,4 @@ export class MainComponent implements OnInit { ...@@ -29,8 +28,4 @@ export class MainComponent implements OnInit {
previous() : void { previous() : void {
this.selected = (this.selected - 1 + this.images.length) % this.images.length; this.selected = (this.selected - 1 + this.images.length) % this.images.length;
} }
info(i : number) : void {
}
} }
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</a> </a>
<div class="NavSearchContainer"> <div class="NavSearchContainer">
<input class="NavInput" type="text" placeholder="Search.."> <input class="NavInput" type="text" placeholder="Search..">
<a routerLink="/"> <a routerLink="/busqueda">
<i class="fas fa-search fa-2x" style="color:white;"></i> <i class="fas fa-search fa-2x" style="color:white;"></i>
</a> </a>
</div> </div>
......
...@@ -9,7 +9,7 @@ export class ImagesService { ...@@ -9,7 +9,7 @@ export class ImagesService {
"/assets/images/el-equilibrista.jpg", "/assets/images/el-equilibrista.jpg",
"/assets/images/fun-home.jpg", "/assets/images/fun-home.jpg",
"/assets/images/giragringa.jpg", "/assets/images/giragringa.jpg",
"/assets/images/FOREVER-YOUNG.jpg", "/assets/images/forever-young.jpg",
]; ];
constructor() {} constructor() {}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!