I am currently delving into a new project utilizing angular 4, a learning experience on the fly for me as I previously worked with angular 1.5.X. This is my first venture into the realm of angular 4.
Here are some insights I have gathered. Despite your hesitance to mix angular routing with .net applications, combining them is quite straightforward. Hopefully, this information will steer you in the right direction.
To begin with, as mentioned by @Ilya.Sulimanov, an Angular 4 Application operates as a self-contained SPA with Routing and Building functionalities like WebPack.
When it comes to implementing authentication, there might be a bit of a challenge using both angular 4 and .Net. Integrating Angular-based authentication seamlessly with .Net identity isn't natively supported. Opting for token-based authentication layered atop identity proves to be a solution. While setting this up requires effort, it ensures compatibility for future endeavors such as mobile app development.
Alternatively, consider a hybrid approach for authentication. Utilize view-based pages (forms authentication) for tasks like login, signup, and password changes. Once authenticated, redirect users to the SPA and apply the "Authorized" attribute to all API calls for the SPA. However, keep in mind that you'll need to include HTTP error handling on the angular side to continuously verify user authentication status. In case of timeout or logout, prompt redirection to the login page via the angular router.
Key points to remember,
Establish a fixed URL for your SPA; for instance, www.example.com/spa. All angular routing activities should stem from this base path, e.g., www.example.com/spa/#/home.
I'm facing some challenges syncing webpack with .netcore, considering my background in Gulp-based workflows. The learning curve appears steep at the moment.
This information should aid in making informed decisions about your course of action.
Great starting points include,
UI
Some Apps [ideal for kicking off],
Update
Discovered this resource https://github.com/MarkPieszak/aspnetcore-angular2-universal. It offers valuable insights on configuring webpack within a .net core development environment.
None of the examples I've come across present a one-stop solution. Nevertheless, each contributes to resolving distinct issues along the journey towards a comprehensive solution.