docs(deeplinks): improve docs (#880)

The routeWithNavController method returns an observable, thus it has to be subscribed to, to get it working.

Change the documentation of the method to show that we need to subscribe to the observable, just like when using the route method.
This commit is contained in:
Juan G. Jordán 2016-12-15 08:07:26 +01:00 committed by Ibrahim Hadeed
parent 700fb47b73
commit 3a11d290e5

View File

@ -53,7 +53,15 @@ export interface DeeplinkMatch {
* Deeplinks.routeWithNavController(this.navController, {
'/about-us': AboutPage,
'/products/:productId': ProductPage
});
}).subscribe((match) => {
// match.$route - the route we matched, which is the matched entry from the arguments to route()
// match.$args - the args passed in the link
// match.$link - the full link data
console.log('Successfully matched route', match);
}, (nomatch) => {
// nomatch.$link - the full link data
console.error('Got a deeplink that didn\'t match', nomatch);
});
* ```
*
* See the [Ionic 2 Deeplinks Demo](https://github.com/driftyco/ionic2-deeplinks-demo/blob/master/app/app.ts) for an example of how to