Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavRouter: getPathRecognizerByComponent fails if ion-nav is inside a router-outlet. #5997

Closed
jimitndiaye opened this issue Mar 31, 2016 · 1 comment
Assignees
Milestone

Comments

@jimitndiaye
Copy link

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/

Short description of the problem:

I have an ion-nav on a page which is in turn navigated to using angular2/router. I use angular2/router because I need this component to be asynchronously loaded. I get a null-reference error as a result of NavRouter's getPathRecognizerByComponent

What behavior are you expecting?

That I don't get an error.

Steps to reproduce:

  1. Include an ion-nav in a component
  2. Navigate to that component using the built-in router (angular2/router)
// component.html
<header>
  <ion-toolbar position="top">
    <!-- some other components -->
  </ion-toolbar>
</header>
<main>
  <ion-content>
    <ion-row>
      <ion-column>
        <!-- some unrelated component -->
      </ion-column>
      <ion-column>
       <ion-nav [root]="rootPage"></ion-nav>
      </ion-column>
      <ion-column >
      </ion-column>
    </ion-row>
  </ion-content>
</main>
<footer>
  <ion-toolbar position="bottom">
    <!-- some other component -->
  </ion-toolbar>
</footer>

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Stack trace:
TypeError: Cannot read property 'find' of undefined at eval (eval at <anonymous> (http://localhost:3000/js/main.bundle.js:393:2), <anonymous>:84:43) at Map.forEach (native) at NavRouter.getPathRecognizerByComponent (eval at <anonymous>

Which Ionic Version? 1.x or 2.x
2.0.0-beta.3

Run ionic info from terminal/cmd prompt: (paste output below)

@jgw96 jgw96 added this to the 2.0.0-beta.5 milestone Mar 31, 2016
@jgw96
Copy link
Contributor

jgw96 commented Mar 31, 2016

Hello! Thanks for opening an issue with us! I have added this issue to the 2.0.0-beta.5 milestone as we are working on ionic 2 working with the angular 2 router as a feature for beta.5. Thanks again!

@adamdbradley adamdbradley self-assigned this Mar 31, 2016
adamdbradley added a commit that referenced this issue Apr 6, 2016
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants