I have a mvc 5 project with a angular frontend . I wanted to add routing as described in this tutorial https://angular.io/guide/router. So in my _Layout.cshtml
I ad
Its just better to create a routing component that would handle all your routes! From the angular website documentation! That's good practice!
ng generate module app-routing --flat --module=app
The above CLI generates a routing module and adds to your app module, all you need to do from the generated component is to declare your routes, also don't forget to add this:
exports: [
RouterModule
],
to your ng-module decorator as it doesn't come with the generated app-routing module by default!