diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index f4817e5..9f512f2 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,49 +1,53 @@ -import { NgModule } from '@angular/core'; -import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; -import { LoginPage } from './login/login.page'; - - -const routes: Routes = [ - - { - path: 'login', - component: LoginPage - }, - { - path: 'tabs', - loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule) - }, - { - path: 'tabsUser', - loadChildren: () => import('./tabs-user/tabs-user.module').then(m => m.TabsUserPageModule) - }, - { - path: 'view-evento', - loadChildren: () => import('./view-evento/view-evento.module').then( m => m.ViewEventoPageModule) - }, - { - path: 'galeriamodal', - loadChildren: () => import('./galeriamodal/galeriamodal.module').then( m => m.GaleriamodalPageModule) - }, - { - path:'', - redirectTo: 'login', - pathMatch: 'full' - }, - { - path: 'tabs-user', - loadChildren: () => import('./tabs-user/tabs-user.module').then( m => m.TabsUserPageModule) +import { NgModule } from '@angular/core'; +import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; +import { LoginPage } from './login/login.page'; + + +const routes: Routes = [ + + { + path: 'login', + component: LoginPage + }, + { + path: 'tabs', + loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule) + }, + { + path: 'tabsUser', + loadChildren: () => import('./tabs-user/tabs-user.module').then(m => m.TabsUserPageModule) + }, + { + path: 'view-evento', + loadChildren: () => import('./view-evento/view-evento.module').then( m => m.ViewEventoPageModule) + }, + { + path: 'galeriamodal', + loadChildren: () => import('./galeriamodal/galeriamodal.module').then( m => m.GaleriamodalPageModule) + }, + { + path:'', + redirectTo: 'login', + pathMatch: 'full' + }, + { + 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: [ - RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) - ], - exports: [RouterModule] -}) -export class AppRoutingModule {} + + + + + +]; +@NgModule({ + imports: [ + RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) + ], + exports: [RouterModule] +}) +export class AppRoutingModule {} diff --git a/src/app/feed/feed-routing.module.ts b/src/app/feed/feed-routing.module.ts new file mode 100644 index 0000000..6fd7a3d --- /dev/null +++ b/src/app/feed/feed-routing.module.ts @@ -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 {} diff --git a/src/app/feed/feed.component.html b/src/app/feed/feed.component.html deleted file mode 100644 index 229abb4..0000000 --- a/src/app/feed/feed.component.html +++ /dev/null @@ -1,3 +0,0 @@ -

- feed works! -

diff --git a/src/app/feed/feed.component.ts b/src/app/feed/feed.component.ts deleted file mode 100644 index da2fc7a..0000000 --- a/src/app/feed/feed.component.ts +++ /dev/null @@ -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() {} - -} diff --git a/src/app/feed/feed.module.ts b/src/app/feed/feed.module.ts new file mode 100644 index 0000000..4e6e999 --- /dev/null +++ b/src/app/feed/feed.module.ts @@ -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 {} diff --git a/src/app/feed/feed.page.html b/src/app/feed/feed.page.html new file mode 100644 index 0000000..56450ed --- /dev/null +++ b/src/app/feed/feed.page.html @@ -0,0 +1,33 @@ + + + Eventos Próximos + + + + + + + +
+ + +
+
+ {{evento.nombre}} · + + {{evento.fecha}} · + + {{evento.precio1}},{{evento.precio2}} + +
+
+ {{evento.descripcion}} +
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/app/feed/feed.component.scss b/src/app/feed/feed.page.scss similarity index 100% rename from src/app/feed/feed.component.scss rename to src/app/feed/feed.page.scss diff --git a/src/app/feed/feed.component.spec.ts b/src/app/feed/feed.page.spec.ts similarity index 61% rename from src/app/feed/feed.component.spec.ts rename to src/app/feed/feed.page.spec.ts index 009b6e6..a6dba8c 100644 --- a/src/app/feed/feed.component.spec.ts +++ b/src/app/feed/feed.page.spec.ts @@ -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; +describe('FeedPage', () => { + let component: FeedPage; + let fixture: ComponentFixture; 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(); })); diff --git a/src/app/feed/feed.page.ts b/src/app/feed/feed.page.ts new file mode 100644 index 0000000..4c46af7 --- /dev/null +++ b/src/app/feed/feed.page.ts @@ -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; + } + +} diff --git a/src/app/login/login.page.html b/src/app/login/login.page.html index cacbd4a..3f7179e 100644 --- a/src/app/login/login.page.html +++ b/src/app/login/login.page.html @@ -6,7 +6,7 @@ Usuario: - Contraseña: + Contraseña: Login diff --git a/src/app/tab2/tab2-routing.module.ts b/src/app/tab2/tab2-routing.module.ts index e96ec09..d654720 100644 --- a/src/app/tab2/tab2-routing.module.ts +++ b/src/app/tab2/tab2-routing.module.ts @@ -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, } ]; diff --git a/src/app/tab2/tab2.page.html b/src/app/tab2/tab2.page.html index 56450ed..e69de29 100644 --- a/src/app/tab2/tab2.page.html +++ b/src/app/tab2/tab2.page.html @@ -1,33 +0,0 @@ - - - Eventos Próximos - - - - - - - -
- - -
-
- {{evento.nombre}} · - - {{evento.fecha}} · - - {{evento.precio1}},{{evento.precio2}} - -
-
- {{evento.descripcion}} -
-
-
-
-
-
-
-
-
\ No newline at end of file diff --git a/src/app/tab2/tab2.page.ts b/src/app/tab2/tab2.page.ts index 300414f..bba1910 100644 --- a/src/app/tab2/tab2.page.ts +++ b/src/app/tab2/tab2.page.ts @@ -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; + } }