URL navigation with NON-native Ionic app?


#1

Hi,

I’d just would like to redirect my users to a specific Ionic page when they come from a specific url (that will be very handfull in email links like reset password, etc.)

I looked for information but the current state of this feature seems really unclear to me, and not well documentated in ionic.

I read about deep-linking here: http://blog.ionic.io/deeplinking-in-ionic-apps/
But as I’m in a WEB app, I can’t use Cordova features right now.

As said by queeji in comments of the blog post:

There are a number of unanswered questions about getting this to work for a web based app that are not addressed here, in the docs, or in the forum. (In the forum, questions simply go unanswered.) It would be great if there were more documentation or a complete example app that allowed for true URL based navigation. Or, if it isn’t supported, it should be stated clearly.

Thanks for your help.


#2

in your app.module.ts you can add a links object for deep linking:

@NgModule({
    ...,
    IonicModule.forRoot(App, {}, {
      links: [
        { component: MyPage, name: 'MyPage', segment: 'something/:parameter' },
        ...
      ]
    })
  ],
  bootstrap: [IonicApp],
 ...
})

if you are do a navpush with the MyPage component it will translate your component and params to the url