0

I’m trying to navigate to a new screen including tab navigation (in a new module) after successful login, but I’m getting the following error: Failed to find module: “./start/start.module”, relative to app://

It’s most likely related to a missing import, but I couldn’t figure out the problem yet. I’ve read through some Github issues, but their suggestions failed me so far.

Has anyone else encountered this before? (some of the code below)

You can also look into a structure fairly similar to what I'm trying to achieve in this link. There's currently an issue in the playground but I'm looking into it (Error: Cannot match any routes. URL Segment: 'profile')

Thanks

// app-routing.module.ts

(...)
const routes: Routes = [
  { path: "", redirectTo: "/login", pathMatch: "full" },
  { path: "login", component: LoginComponent },
  { path: "start", loadChildren: "./start/start.module#StartModule" }
];

// login.component.ts

login() {
  (...)
  this.router.navigate(["/start"]);
}

// start-routing.module.ts

const routes: Routes = [
  {
    path: "",
    redirectTo: "/(homeTab:home//browseTab:browse//searchTab:search)",
    pathMatch: "full"
  },

  { path: "home", component: HomeComponent, outlet: "homeTab" },
  { path: "browse", component: BrowseComponent, outlet: "browseTab" },
  { path: "search", component: SearchComponent, outlet: "searchTab" },

  { path: "item/:id", component: ItemDetailComponent, outlet: "homeTab" }
];

@NgModule({
  imports: [NativeScriptRouterModule.forRoot(routes)],
  exports: [NativeScriptRouterModule]
})
export class StartRoutingModule {}

// start.module.ts

import { StartRoutingModule } from "./start-routing.module";

@NgModule({
  imports: [
    NativeScriptModule,
    NativeScriptCommonModule,
    StartRoutingModule
  ],
  declarations: [
    BrowseComponent,
    HomeComponent,
    ItemDetailComponent,
    SearchComponent,
    StartComponent
  ],
  exports: [
    StartRoutingModule
  ],
  schemas: [NO_ERRORS_SCHEMA]
})
export class StartModule {}
2
  • Is it possible for you to reproduce the issue with Playground? Commented Oct 1, 2018 at 19:18
  • @Manoj I'm trying to do so (linked provided above), but I'm encountering another issue in the playground. I'd appreciate it if you could look into that issue, as I believe it is related to my original problem. All in all, I think the scenario I'm trying to implement has a better solution that I haven't figured out yet. Commented Oct 1, 2018 at 19:39

1 Answer 1

2

There is a open feature request to support multiple scenarios using nested router outlets, hope it will be ready with NativeScript 5.0 & Angular 6.2.0

Sign up to request clarification or add additional context in comments.

2 Comments

So what I'm trying to accomplish isn't feasible just yet? If not, how does one implement what I'm trying to accomplish? (click on a button in a component, navigate to another component which allows tab navigation)
Actually never mind, the feature request link you've provided is quite helpful. If you'd like to share your experience with it, though, please feel free to inform me more. This feature certainly feels essential to any application; I hope 5.0 contains this. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.