I'm trying to use ng-html2js in order to fill my $templateCache to run some unit tests.
Problem is, that my templates are located on a different project, and I use a relative path to them:
preprocessors: {
'..//project2//Content//Templates/**/*.html': ['ng-html2js']
},
It turns that the cache entries are stored as:
"C:\Users\user\Documents\GitHub\solutiondir\project2\Content\Templates\"
Question:
Is there any stripPrefix value that I could use to remove the entire:
C:\Users\user\Documents\GitHub\solutiondir\project2\, and that would work regardless of the user name?
It might be, basically, figuring out the right Regex it seems, as the code of the preprocessor is like so:
var log = logger.create('preprocessor.html2js');
var moduleName = config.moduleName;
var stripPrefix = new RegExp('^' + (config.stripPrefix || ''));
var prependPrefix = config.prependPrefix || '';
var stripSufix = new RegExp((config.stripSufix || '') + '$');
var cacheIdFromPath = config && config.cacheIdFromPath || function(filepath) {
return prependPrefix + filepath.replace(stripPrefix, '').replace(stripSufix, '');
};