Ionic 3 同时进行深度链接和延迟加载 [英] Ionic 3 deep-linking and lazy-loading at the same time

查看:37
本文介绍了Ionic 3 同时进行深度链接和延迟加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我在

解决方案

我在 2018 年看到同样的错误.似乎深度链接和延迟加载不能很好地配合使用.我建议使用以下cordova插件:

https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking

According to what I've read in the documentation and forums, you enable deep-linking via : forRoot(appRoot, config, deepLinkConfig)

@ngModule({
  ..
  IonicModule.forRoot(MyApp, {}, {
    links:[{ component: ContactPage, name: "contact", segment: "contact"},
           { component: HelloPage, name: "hello", segment: "hello" }
          ]
  })
  ...
}) ...

This leads to adding ContactPage and HelloPage to declarations and entryComponents arrays within @ngModule, which would not be lazy-loaded.

So, this leads to the question, can you substitute strings, doing away with the imports and double array declaration, and have this?

@ngModule({
  ..
  IonicModule.forRoot(MyApp, {}, {
    links:[{ component: 'ContactPage', name: "contact", segment: "contact"},
           { component: 'HelloPage', name: "hello", segment: "hello" }
          ]
  })
  ...
}) ...

and achieve lazy-loading at the same time?

Update: Tried with a single Tabs page. I'm guessing it's not working ATM.

解决方案

I'm seeing same error in 2018. It seems deep links and lazy loading don't play well together. I propose to use the following cordova plugin :

https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking

这篇关于Ionic 3 同时进行深度链接和延迟加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆