Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

child route does not start my components (Angular13)

I am having problems when I access a child route of a child route, when I go to the url I still get the same component and it does not change it.


{ path: 'PMI', component: AppContainerComponent, children: [
        { path: 'home', component: HomeComponent },

        { path: 'users', component: IndexUsersComponent, canActivate: [AdminGuard] },

        { path: 'patients', component: IndexPatientComponent, canActivate: [AdminGuard], children: [
            { path: 'basic-data/:id', component: BasicDataPatientComponent, canActivate: [AdminGuard] },
            { path: 'supplemental-data/:id', component: SupplementalDataPatientComponent, canActivate: [AdminGuard] },
        ]},
    ]},

If I go to a child route of the ‘PMI’ path as home, users and patients it works, but trying to access a child route of the ‘patients’ path as basic data or supplementary data does not open the component.

this is the route I use for basic data for example:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

‘localhost:4200/PMI/patients/basic-data/2’

>Solution :

Please add a router-outlet in IndexPatientComponent for child route to work.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading