I am trying to create the route inside the tabs. But I am not able to implement it. I have created the component inside one of my tab and I want to navigate to that component.
Below is my code
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { IonicModule } from '@ionic/angular';
import { ReadingsPage } from './readings.page';
import { ReadingDetailComponent } from './pages/reading-detail/reading-detail.component';
const routes: Routes = [
{
path: '',
children:[
{
path:'',
component: ReadingsPage
},
{
path:'detail',
component:ReadingDetailComponent
}
]
}
];
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [ReadingsPage,ReadingDetailComponent]
})
export class ReadingsPageModule {}
I am trying to navigate to my url using following function:-
showDetail(){
this.router.navigate(['./detail'])
}
Any help would be appreciated