Created
July 22, 2014 13:04
-
-
Save stephen-james/b9114e22c7508f17e1cd to your computer and use it in GitHub Desktop.
cache templates by site area
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ngHtml2JsPreprocessor = { | |
| cacheIdFromPath: function(filepath) { | |
| var areaTemplatePattern = /\/?.*\/(.*)\/[Tt]emplates\/(.*\.html)/g; | |
| var pathParts = areaTemplatePattern.exec(filePath); | |
| // cachedTemplates/<AreaName>/<TemplateFileName.html> | |
| var cachedName = 'cachedTemplates/' + pathParts[1] + '/' + pathParts[2]; | |
| console.log("[ caching preprocessed template ] " + cachedName + "; original filePath:=" + filePath); | |
| return cachedName; | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment