有人将如何在Angular-Nativescript的标签导航中实现模态导航?

时间:2019-04-02 09:38:48

标签: tabs angular-ui-router modal-dialog nativescript angular2-nativescript

我一直在努力在Modal Navigation的{​​{1}}内部实现Tab Navigation。因此,我想知道是否有人对如何实现我所寻找的东西有很好的实践。

我尝试了多种方法,但是没有一种方法有效,由于大多数错误都涉及Nativescript,因此我可能对router navigation缺乏深入的了解。

这里有一个navigation,它试图复制我要实现的目标:https://play.nativescript.org/?template=play-ng&id=VdmiR9&v=8

经常发生的错误是:

  1. playground

  2. CONSOLE ERROR [native code]: ERROR Error: No componentRef found in DetachedRouteHandle

(尽管ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[FirstModalComponent -> ModalDialogParams]被注入ModalDialogService内)

  1. AppModule

(虽然No component factory found for RootModalComponent. Did you add it to @NgModule.entryComponents已添加到延迟加载的模块的entryComponents中,所以我将其添加至AppModule)

  1. RootModalComponent

(此错误很奇怪,因为在某些项目中,模块的延迟加载与此导入'〜/ app'一起工作,而在其他项目中却失败了)

  1. Can't resolve '~/app' in...

(这个错误一直发生,似乎我并不完全掌握实现路线的方式)

如果有人知道在Error: Cannot match any routes. URL Segment: 'tabs/default'内进行modal navigation的方式,那对我会有很大帮助。

1 个答案:

答案 0 :(得分:1)

当前,在tabview框架中,Nativescript Angular内部的模式导航有些错误,但是有一种解决方法。您可以在以下运动场示例中找到此modal navigation的完整实现:​​https://play.nativescript.org/?template=play-ng&id=TkK7sQ&v=5

更多信息,请看一下我在其GitHub存储库上创建的这个问题:https://github.com/NativeScript/nativescript-angular/issues/1774