creada página feed
This commit is contained in:
parent
427398154b
commit
277ad1d88a
|
@ -33,12 +33,16 @@ const routes: Routes = [
|
|||
{
|
||||
path: 'tabs-user',
|
||||
loadChildren: () => import('./tabs-user/tabs-user.module').then( m => m.TabsUserPageModule)
|
||||
},
{
|
||||
path: 'feed',
|
||||
loadChildren: () => import('./feed/feed.module').then( m => m.FeedPageModule)
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
];
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { FeedPage } from './feed.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: FeedPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class FeedPageRoutingModule {}
|
|
@ -1,3 +0,0 @@
|
|||
<p>
|
||||
feed works!
|
||||
</p>
|
|
@ -1,14 +0,0 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-feed',
|
||||
templateUrl: './feed.component.html',
|
||||
styleUrls: ['./feed.component.scss'],
|
||||
})
|
||||
export class FeedComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
}
|
|
@ -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 { FeedPageRoutingModule } from './feed-routing.module';
|
||||
|
||||
import { FeedPage } from './feed.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
FeedPageRoutingModule
|
||||
],
|
||||
declarations: [FeedPage]
|
||||
})
|
||||
export class FeedPageModule {}
|
|
@ -0,0 +1,33 @@
|
|||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Eventos Próximos</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col size="12">
|
||||
<div *ngIf="eventos.length>0" class="eventos">
|
||||
<ion-list>
|
||||
<ion-item *ngFor="let evento of eventos" button (click)="mostrarEvento(evento)">
|
||||
<div class="evento">
|
||||
<div class="eventoHeader">
|
||||
{{evento.nombre}} ·
|
||||
<ion-icon name="calendar-outline"></ion-icon>
|
||||
{{evento.fecha}} ·
|
||||
<ion-icon name="cash-outline"></ion-icon>
|
||||
{{evento.precio1}},{{evento.precio2}}
|
||||
<ion-button (click)="editarEvento(evento);$event.stopPropagation();"><ion-icon name="pencil-outline"></ion-icon></ion-button>
|
||||
</div>
|
||||
<div class="eventoDesc">
|
||||
{{evento.descripcion}}
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-content>
|
|
@ -1,19 +1,19 @@
|
|||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { FeedComponent } from './feed.component';
|
||||
import { FeedPage } from './feed.page';
|
||||
|
||||
describe('FeedComponent', () => {
|
||||
let component: FeedComponent;
|
||||
let fixture: ComponentFixture<FeedComponent>;
|
||||
describe('FeedPage', () => {
|
||||
let component: FeedPage;
|
||||
let fixture: ComponentFixture<FeedPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ FeedComponent ],
|
||||
declarations: [ FeedPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(FeedComponent);
|
||||
fixture = TestBed.createComponent(FeedPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
|
@ -0,0 +1,20 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { Eventoi } from '../interfaces/eventoi';
|
||||
import { FeedService } from '../services/feed.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-feed',
|
||||
templateUrl: './feed.page.html',
|
||||
styleUrls: ['./feed.page.scss'],
|
||||
})
|
||||
export class FeedPage implements OnInit {
|
||||
|
||||
eventos: Eventoi[];
|
||||
|
||||
constructor(private feedService:FeedService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.eventos = this.feedService.eventos;
|
||||
}
|
||||
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<ion-content>
|
||||
<span>Usuario: </span><input type="text" id="username">
|
||||
<span>Contraseña: </span><input type="text" id="password">
|
||||
<span>Contraseña: </span><input type="password" id="password">
|
||||
<ion-button (click)="login()">
|
||||
Login
|
||||
</ion-button>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { FeedPage } from '../feed/feed.page';
|
||||
import { Tab2Page } from './tab2.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: Tab2Page,
|
||||
component: FeedPage,
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Eventos Próximos</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col size="12">
|
||||
<div *ngIf="eventos.length>0" class="eventos">
|
||||
<ion-list>
|
||||
<ion-item *ngFor="let evento of eventos" button (click)="mostrarEvento(evento)">
|
||||
<div class="evento">
|
||||
<div class="eventoHeader">
|
||||
{{evento.nombre}} ·
|
||||
<ion-icon name="calendar-outline"></ion-icon>
|
||||
{{evento.fecha}} ·
|
||||
<ion-icon name="cash-outline"></ion-icon>
|
||||
{{evento.precio1}},{{evento.precio2}}
|
||||
<ion-button (click)="editarEvento(evento);$event.stopPropagation();"><ion-icon name="pencil-outline"></ion-icon></ion-button>
|
||||
</div>
|
||||
<div class="eventoDesc">
|
||||
{{evento.descripcion}}
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-content>
|
|
@ -9,11 +9,11 @@ import { FeedService } from '../services/feed.service';
|
|||
})
|
||||
export class Tab2Page implements OnInit{
|
||||
|
||||
eventos: Eventoi[];
|
||||
constructor(private feedService: FeedService) {}
|
||||
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(){
|
||||
this.eventos = this.feedService.eventos;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue