Permite añadir eventos a la discoteca y navegar a una página de cada evento

This commit is contained in:
2021-02-02 16:42:38 +01:00
parent af852bff37
commit 594332fd87
15 changed files with 97 additions and 31 deletions

View File

@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ViewEventoPage } from './view-evento.page';
const routes: Routes = [
{
path: '',
component: ViewEventoPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class ViewEventoPageRoutingModule {}

View File

@@ -1,3 +0,0 @@
<p>
view-evento works!
</p>

View File

@@ -1,14 +0,0 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-view-evento',
templateUrl: './view-evento.component.html',
styleUrls: ['./view-evento.component.scss'],
})
export class ViewEventoComponent implements OnInit {
constructor() { }
ngOnInit() {}
}

View File

@@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { ViewEventoPageRoutingModule } from './view-evento-routing.module';
import { ViewEventoPage } from './view-evento.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ViewEventoPageRoutingModule
],
declarations: [ViewEventoPage]
})
export class ViewEventoPageModule {}

View File

@@ -0,0 +1,9 @@
<ion-header>
<ion-toolbar>
<ion-title>ViewEvento</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<label>{{evento.nombre}}</label>
</ion-content>

View File

@@ -1,19 +1,19 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { ViewEventoComponent } from './view-evento.component';
import { ViewEventoPage } from './view-evento.page';
describe('ViewEventoComponent', () => {
let component: ViewEventoComponent;
let fixture: ComponentFixture<ViewEventoComponent>;
describe('ViewEventoPage', () => {
let component: ViewEventoPage;
let fixture: ComponentFixture<ViewEventoPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViewEventoComponent ],
declarations: [ ViewEventoPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(ViewEventoComponent);
fixture = TestBed.createComponent(ViewEventoPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));

View File

@@ -0,0 +1,20 @@
import { Component, OnInit } from '@angular/core';
import { Evento } from '../evento';
import { Tab1Service } from '../tab1/tab1.service';
@Component({
selector: 'app-view-evento',
templateUrl: './view-evento.page.html',
styleUrls: ['./view-evento.page.scss'],
})
export class ViewEventoPage implements OnInit {
evento: Evento;
constructor(private tab1Service: Tab1Service) { }
ngOnInit() {
this.evento = this.tab1Service.getEventobyIndex(this.tab1Service.eventoIndex);
}
}