Angular router-outlet directive doesnt work twice

Discussão em 'Angular' iniciado por user17293718, Janeiro 27, 2025.

  1. user17293718

    user17293718 Guest

    i have a litte problem. My router-outlet tag in app.component.html works fine for the first time. If i need to navigate back to this component or click "back" in the browser, it is simply not gets rendered. I would like to know why. The navbar-bottom component do gets rendered, but not what should be placed in router-outlet. I did not have this problems with different routes then '', so i guess the problem might be there?!


    <main>
    <router-outlet></router-outlet>
    <app-navbar-bottom *ngIf="renderMenuBar"></app-navbar-bottom>
    </main>

    So in this case the component in my routing-module tagged by path:'' gets rendered like i desire:

    app-routing-module.ts:

    const routes: Routes = [{path: '', component: MyPreperationViewComponent}]


    The router-outlet itself seems to render other components fine...is it possible that the error is related, that i places the outlet directive inside app.component.html? Simply expose another route for the same component did not help eather. Any help would be highly appriciate be me. Regards, Marc

    Continue reading...

Compartilhe esta Página