How to define optional segment parameter in Ionic Page?
问题 How it is possible to define a optional parameter in Ionic 3 PWA? My current @IonicPage decorator looks like: @IonicPage({ segment: "landing/:id" }) But the id param must be optional. If I do not pass the id , I receive this error: Uncaught (in promise): invalid views to insert How to do it? Thanks in advance! 回答1: There is no method yet.You need to send empty string when you don’t need it.That is the workaround for this now. this.navCtrl.push('landing', { 'id': '' }) 回答2: Since Ionic 4 with