I cannot find a single document that explains how to use optional params in segments.
In my app.module.ts I have this 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);
],
The user should be able to access his profile via /profile
, but also consult another user's profile with /profile/:userId
. But when I try to access /profile, I get an error :
Uncaught (in promise): invalid views to insert
Via navCtrl, it's possible to go to 'profile' with an empty string as the userId, but once you actualize the page, it goes blank.
Is there a way to make the params optional in deeplinking ?