From 17838e044cff86c1aa20d306c0898997ce897ea2 Mon Sep 17 00:00:00 2001 From: perploug Date: Fri, 24 Jan 2014 17:20:34 +0100 Subject: [PATCH] Addss template clearing when in debugmode (cherry picked from commit 7d2f6c13c36726868d0f4ad478a7ccf72d793c3a) --- src/Umbraco.Web.UI.Client/src/init.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/init.js b/src/Umbraco.Web.UI.Client/src/init.js index 57df26b532..974cfe97ee 100644 --- a/src/Umbraco.Web.UI.Client/src/init.js +++ b/src/Umbraco.Web.UI.Client/src/init.js @@ -47,6 +47,15 @@ app.run(['userService', '$log', '$rootScope', '$location', 'navigationService', $location.path(rejection.path).search(rejection.search); }); + + /** For debug mode, always clear template cache to cut down on + dev frustration and chrome cache on templates */ + if(Umbraco.Sys.ServerVariables.isDebuggingEnabled){ + $rootScope.$on('$viewContentLoaded', function() { + $templateCache.removeAll(); + }); + } + /* this will initialize the navigation service once the application has started */ navigationService.init();