Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

We have an MVC project with AngularJS sitting on top of it. Question - is possible to preload static HTML files (partial templates) into templateUrl property for Angular's custom components or directives.

If it is possible, can I use Angular's @templateCache to make the project work offline?

The reason I am asking is that in all examples I have found, there is no MVC, just plain html folder structure.

But with MVC all requests to load a view go through MVC Controller's Action, that loads the view.

So, by specifying templateUrl: 'mypartialview.html' will do nothing since I dont have .html files, also there is no such path that will tell templateUrl where to look for a template. by specifying templateUrl: '/HomeController/mypartial/' - can this be done? to get the partial view?

If yes, can I cache it using Angular's @templateCache to make the project work offline?

Thanks.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.