separado routing de usuarios y discotecas

This commit is contained in:
onsaliyo 2021-04-03 12:11:01 +02:00
parent 139e3fcb8b
commit 4ee33458dc
10 changed files with 123 additions and 19 deletions

View File

@ -13,6 +13,10 @@ const routes: Routes = [
path: 'tabs', path: 'tabs',
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule) 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', path: 'view-evento',
loadChildren: () => import('./view-evento/view-evento.module').then( m => m.ViewEventoPageModule) loadChildren: () => import('./view-evento/view-evento.module').then( m => m.ViewEventoPageModule)
@ -26,6 +30,11 @@ const routes: Routes = [
redirectTo: 'login', redirectTo: 'login',
pathMatch: 'full' pathMatch: 'full'
}, },
{
path: 'tabs-user',
loadChildren: () => import('./tabs-user/tabs-user.module').then( m => m.TabsUserPageModule)
},

View File

@ -16,7 +16,7 @@ export class FeedService {
this.apiService.getEventos() this.apiService.getEventos()
.subscribe(eventos => { .subscribe(eventos => {
this.eventos = eventos; this.eventos = eventos;
this.router.navigate(['/tabsUser'])
}) })
} }
} }

View File

@ -0,0 +1,34 @@
import { FullscreenOverlayContainer } from '@angular/cdk/overlay';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { TabsUserPage } from './tabs-user.page';
const routes: Routes = [
{
path: '',
component: TabsUserPage,
children: [
{
path: 'tab2',
loadChildren: ()=> import('../tab2/tab2.module').then(m=>m.Tab2PageModule),
},
{
path: 'tab3',
loadChildren: ()=> import('../tab3/tab3.module').then(m=>m.Tab3PageModule),
},
{
path:'',
redirectTo: 'tab2',
pathMatch: 'full'
}
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class TabsUserPageRoutingModule {}

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 { TabsUserPageRoutingModule } from './tabs-user-routing.module';
import { TabsUserPage } from './tabs-user.page';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
TabsUserPageRoutingModule
],
declarations: [TabsUserPage]
})
export class TabsUserPageModule {}

View File

@ -0,0 +1,17 @@
<ion-tabs>
<ion-tab-bar slot="bottom">
<ion-tab-button tab="tab2">
<ion-icon name="search-outline"></ion-icon>
<ion-label>Feed</ion-label>
</ion-tab-button>
<ion-tab-button tab="tab3">
<ion-icon name="accessibility-outline"></ion-icon>
<ion-label>Me</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>

View File

View File

@ -0,0 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { TabsUserPage } from './tabs-user.page';
describe('TabsUserPage', () => {
let component: TabsUserPage;
let fixture: ComponentFixture<TabsUserPage>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TabsUserPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(TabsUserPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-tabs-user',
templateUrl: './tabs-user.page.html',
styleUrls: ['./tabs-user.page.scss'],
})
export class TabsUserPage implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@ -11,14 +11,7 @@ const routes: Routes = [
path: 'tab1', path: 'tab1',
loadChildren: () => import('../tab1/tab1.module').then(m => m.Tab1PageModule), loadChildren: () => import('../tab1/tab1.module').then(m => m.Tab1PageModule),
}, },
{
path: 'tab2',
loadChildren: () => import('../tab2/tab2.module').then(m => m.Tab2PageModule)
},
{
path: 'tab3',
loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule)
},
{ {
path: '', path: '',
redirectTo: 'tab1', redirectTo: 'tab1',

View File

@ -2,19 +2,11 @@
<ion-tab-bar slot="bottom"> <ion-tab-bar slot="bottom">
<ion-tab-button tab="tab1"> <ion-tab-button tab="tab1">
<ion-icon name="triangle"></ion-icon> <ion-icon name="home-outline"></ion-icon>
<ion-label>Tab 1</ion-label> <ion-label>Perfil</ion-label>
</ion-tab-button> </ion-tab-button>
<ion-tab-button tab="tab2">
<ion-icon name="ellipse"></ion-icon>
<ion-label>Tab 2</ion-label>
</ion-tab-button>
<ion-tab-button tab="tab3">
<ion-icon name="square"></ion-icon>
<ion-label>Tab 3</ion-label>
</ion-tab-button>
</ion-tab-bar> </ion-tab-bar>
</ion-tabs> </ion-tabs>