I have routing set up via $routeProvider, something like
$routeProvider.when('/page/:id',
{templateUrl: 'partials/public/view/page.html', controller: XYZ});
On first page load, I'd like to iterate through cached partials and remove them. Initially I've tried:
$templateCache.removeAll()
called when parent controller (declared over entire body element) is first created - aka page load. Which seems to work, but some 3rd party plugins (directives) then throw error
Error: Failed to load template: template/tabs/tab.html
I know I can remove one partial cache at a time using $templateCache.remove(key) but I don't like the idea of hardcoding all partials keys in some custom clear function. Instead, I'd like to get all cached partials and if key starts with some string, then remove it. My question is, is there a way to iterate all cached partials?