Nativescript/Angular Navigating Back is not working in Children Page

184 Views Asked by At

I navagate from main/tv-theke-page to main-tvtheke/main-tvtheke-home-page, but when i press back in android does not navigate back to main/tv-theke-page it exits from app

It seems is something wrong with route history

const routes: Routes = [
  { path: '', redirectTo: '/main', pathMatch: 'full' },
  { path: 'main', component: MainComponent , 
  children : [
    { path: '', component: HomePageComponent},
    { path: 'search-page', component: SearchPageComponent},
    { path: 'home-page', component: HomePageComponent},
    { path: 'live-tv-page', component: LiveTvPageComponent},
    { path: 'tvtheke-page', component: TvThekePageComponent},
    { path: 'music-page', component: MusicPageComponent},
    { path: 'movie-page', component: MoviePageComponent},
    { path: 'tv-show-page', component: TvShowPageComponent},
    { path: 'favorite-page', component: FavoritePageComponent},
  ]},
  { path: 'main-movie', component: MainMoviePageComponent},
  { path: 'main-tvshow', component: MainTVShowPageComponent},
  { path: 'main-tvtheke', component: MainTVThekeComponent ,
  children : [
    { path: '', component: MainTVThekeHomePageComponent},
    { path: 'main-tvtheke-home-page', component: MainTVThekeHomePageComponent},
    { path: 'main-tvtheke-dailyvdeos-page', component: MainTVThekeDailyVideosComponent},
    { path: 'main-tvtheke-rubric-page', component: MainTVThekeRubricComponent},
    { path: 'main-tvtheke-az-page', component: MainTVThekeAZComponent},
  ]},
]
1

There are 1 best solutions below

0
Tim On

That really depends on how you navigation logic looks. I would suggest you create a playground with your sample here: https://play.nativescript.org/

Also, you might get more info by enabling router tracing in you app-routing.module

@NgModule({
    imports: [
        NativeScriptRouterModule.forRoot(routes, {
            enableTracing: true,