While I have come across 2 similar questions on Stack Overflow and here, none of them seem to provide a solution.
After delving into the Angular repository, I stumbled upon this issue where they inquire about an alternative for templateCache in Angular 2, only to close it suggesting the usage of CachedResourceLoader.
My query is how can we utilize CachedResourceLoader as a replacement for templateCache? Despite scouring through Google search results, I haven't been able to find any relevant information. Perhaps my search approach is misguided or there's something that eludes me.
The response to this question could potentially address those other 2 familiar queries.
Here's an example showcasing the functionality typically provided by templateCache in AngularJS:
Adding:
var myApp = angular.module('myApp', []);
myApp.run(function($templateCache) {
$templateCache.put('templateId.html', 'This is the content of the template');
});
Retrieval via $templateCache:
$templateCache.get('templateId.html')
Or retrieval:
myApp.component('myComponent', {
templateUrl: 'templateId.html'
});