Rom*_*ain 8 deep-linking ionic3 angular
我找不到单个文档来解释如何在段中使用可选参数.
在我的app.module.ts中,我有这个deepLinkConfig:
let deepLinkConfig = {
links: [{
component: HomePage, name: 'Home', segment: 'home'
}, {
component: ConnexionPage, name: 'Connexion', segment: 'connexion'
}, {
component: InscriptionPage, name: 'Inscription', segment: 'inscription'
}, {
component: ProfilePage, name: 'Profile', segment: 'profile/:userId'
}, {
component: ExplorePage, name: 'Explore', segment: 'explore'
}, {
component: FAQPage, name: 'FAQ', segment: 'faq'
}]
};
...
imports: [
...
IonicModule.forRoot(MyApp, {}, deepLinkConfig);
],
Run Code Online (Sandbox Code Playgroud)
用户应该能够通过访问他的个人资料/profile,但也可以咨询其他用户的个人资料/profile/:userId.但是当我尝试访问/配置文件时,我收到一个错误:
未捕获(承诺):要插入的视图无效
通过navCtrl,可以使用空字符串作为userId转到'profile',但是一旦你实现了页面,它就会变成空白.
有没有办法让深层链接中的参数可选?
| 归档时间: |
|
| 查看次数: |
638 次 |
| 最近记录: |