I have this working but in an inelegant fashion
(1) Angular
This puts it's output in the folder
~/Areas/AreaName/Views/ControllerName/ClientApp/(all angular files here)
It has paths like
<button class="k-button" routerLink="AreaName/ControllerName/LazyLoad">LazyLoad</button>
<button class="k-button" [routerLink]="['AreaName/ControllerName/Home']">Home</button>
The route for lazy loading looks like this
{
path: 'AreaName/ControllerName/LazyLoad',
loadChildren: './lazyLoad/lazyLoad.module#LazyLoadedModule'
}
(2) MVC
In the AreaRegistration I have this additional route for Angular code
context.MapRoute(
"Angular",
"AreaName/ControllerName/{*.}",
new { controller = "ControllerName", action = "Index", id = UrlParameter.Optional });
And it runs ok, when it tries to load the lazy loading section it looks in the path
/AreaName/lazyLoad-lazyLoad-module.js
I could understand if it looked in '/' or 'AreaName/ControllerName' or something similar but not that path
To make this work I have code in Global.ascx.cs Application_Error which detects the 404 and redirects it to the correct path, i.e.
~/Areas/AreaName/Views/ControllerName/ClientApp/
Which then works, it loads the lazy loaded file
I'm assuming there's something I need to do on the Angular side but I'm not sure what?
NB This is not the core version of ASP MVC
(Edit, more info) I have found deployUrl in Angular.json. Unfortunately our site can be hosted in any of these ways:
https://OurSite/TopLevel
https://OurSite/_FurtherDown/TopLevel
the href will be set in the index.html, perhaps there's an equivalent for the deployUrl?