Base solution for your next web application
Open Closed

Disable routing to notifications on certain routes #6945


User avatar
0
yoshrepublic created

I have a few public pages that need Angular functionality and no authentication. I have created a public module and added the routes to the root-routing module. The pages work fine until I log in. After I log in if I enter any of the public routes the page shows up for a second then I get redirected to notifications. I tried to do a redirect from ngOnInit on one of the pages but it does not work. Is there any way to disable the automatic redirect to notifications on certain routes? Here is the relevant portion of my root-routing.module.ts: I am on version 6.5

const routes: Routes = [
    { path: '', component: HomeComponent, data: {} },
    { path: 'faqs', component: PublicFaqsComponent, data: {} },
    { path: 'contact-us', component: ContactUsComponent, data: {} },
    { path: 'polls', component: PublicPollsComponent, data: {} },

    {
        path: 'account',
        loadChildren: 'account/account.module#AccountModule', //Lazy load account module
        data: { preload: true }
    }
];

2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    I added an empty component and can't reproduce your problem.

    Can you share the code of one of the components? For example, PublicFaqsComponent

  • User Avatar
    0
    yoshrepublic created

    I have fat-fingered my own redirect. My apologies :(