I encountered an issue with the routing code in my Nativescript app.
Here is the code snippet:
const routes: Routes = [
{
path: 'home',
component: HomeComponent,
canActivate: [AuthGuard],
children: [
{path: 'fp', component: FirstPageComponent},
{path: 'setting', component: SettingsComponent}]},
{
path: 'test',
component: TestComponent,
children: [
{ path: 'login', component: LoginFirstComponent },
{ path: 'login1', component: LoginComponent },
]},
{ path: '', redirectTo: '/home/fp', pathMatch: 'full' }
];
The routing flow should be: home/fp
> home/setting
> test/login
Upon clicking back on mobile, the navigation should reverse from test/login
> home/setting
, but I am encountering this error:
System.err: com.tns.NativeScriptException: System.err: Calling js method run failed... (error details omitted for brevity)
If you have any insights on how to resolve this error, please share. Thank you!