From 3a11d290e5f5e46c260bfac6d28e7c6eb093e948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20G=2E=20Jord=C3=A1n?= Date: Thu, 15 Dec 2016 08:07:26 +0100 Subject: [PATCH] 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. --- src/plugins/deeplinks.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/deeplinks.ts b/src/plugins/deeplinks.ts index b6a71bc4b..d83a10106 100644 --- a/src/plugins/deeplinks.ts +++ b/src/plugins/deeplinks.ts @@ -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