title: NativeScript TabView Navigation
body: <p>I am creating an app starting from the NativeScript TabView template app (<a href="https://github.com/NativeScript/template-tab-navigation-ng" rel="nofollow noreferrer">https://github.com/NativeScript/template-tab-navigation-ng</a>), and I can't figure out how to programmatically navigate to a page within a page-router-outlet from AppComponent. Example:</p>
  
  <pre><code>export class AppComponent{
  
      constructor(private router: RouterExtensions, private currentRoute: ActivatedRoute) {
          // Use the component constructor to inject providers.
      }
  
      getIconSource(icon: string): string {
          const iconPrefix = isAndroid ? "res://" : "res://tabIcons/";
          return iconPrefix + icon;
      }
  
      navigateToPage(): void {
          this.router.navigate(['../page'], { relativeTo: this.currentRoute });
      }
  }
  </code></pre>
  
  <p>This works fine from within a page inside the page-router-outlet, but when I call it from AppComponent, I get a console error such as this:</p>
  
  <pre><code>Cannot match any routes. URL Segment: 'page'
  </code></pre>
  
  <p>My actual code is here: <a href="https://github.com/rchisholm/saint_stan" rel="nofollow noreferrer">https://github.com/rchisholm/saint_stan</a></p>
  
  <p>My actual full error is here, from the debugging console:</p>
  
  <pre><code>Unhandled Promise rejection: Cannot match any routes. URL Segment: 'novena-day/1' ; Zone: &lt;root&gt; ; Task: Promise.then ; Value: Error: Cannot match any routes. URL Segment: 'novena-day/1' Error: Cannot match any routes. URL Segment: 'novena-day/1'
  </code></pre>
  
  <p>My attempted navigation is inside of a LocalNotifications.addOnMessageReceivedCallback in OnInit in AppComponent.</p>
  
  <p>This seems like it should be simple. I am a bit new at this, so any help would be greatly appreciated.</p>
  
  <p>I am using the latest versions of NativeScript, TypeScript, and Angular.</p>
  
  <p>Thanks!</p>