成功登录后,我试图导航到新屏幕,包括选项卡导航(在新模块中),但出现以下错误: 找不到模块:“ ./ start / start.module”,相对于app://
这很可能与缺少导入有关,但是我还不能弄清楚这个问题。我已经阅读了一些有关Github的问题,但到目前为止,他们的建议使我失望了。
之前有人遇到过吗? (下面的一些代码)
您还可以研究与我要实现的in this link类似的结构。游乐场目前存在问题,但我正在调查(错误:无法匹配任何路线。URL段:“配置文件”)
谢谢
// 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 {}