I have created routes like this
{path: 'trainings', component: TrainingWrapperComponent,
children:[
{path: '', component: TrainingsListComponent},
{path: 'createTraining', component: ManageTrainingComponent},
{path: 'trainingLanguage', component: TrainingLanguageComponent},
]
},
Now when I navigate to child route from trainings, I am able to do it. But if I refresh or I try to open the url directly. I am not able to do that.
For instance trainings/createTraining is throwing http errors because it is trying to fetch resources by taking training/ as the base url .
Ok. I finally found the solution. The problem was that the server was not able to recognise my child routes as part of the angular route and thus that error. So, the simplest solution was to change the location strategy used for routing to hashlocationstategy. This immediately solved the problem.