Thursday, 18 May 2017

Angular 4 component with MVC route for templateUrl value can't find file

I know there are many opinions on intermixing MVC server rendering and Angular templates but it has worked well for me in other projects. I use it for handling a lot of the authorization and security before the template is handed off to client, anyways opinions aside..

My current project is first fore into Angular 4 and npm with node_packages. I relied on Nuget/VS studio in the past for package deployment. When building for server deployment I went with the AOT compilation to handle package deployment/tree shaking. The issue is everything works well in JIT mode using System.JS but when I try to build for AOT it complains it cannot find the related file when using something like:

templateUrl: './Account/Register'

I realize why the issue is occurring just wondered if anyone has had tried to do something similar and what the approach was. I am not ready to jump into JS Server side processing just yet as the project has a tight deadline. Thanks in advance.



via Spartan

No comments:

Post a Comment