karma-ng-html2js-preprocessor
karma-ng-html2js-preprocessor copied to clipboard
filepath.strip is not a function
I am leaning heavily on cacheIdFromPath to see why my files which show up in the debugger are not showing up in the tests.
I am having no problem using the commented out part to set a path (but still cannot test my directives). For some reason the path wants to go all the way back to my directory.
I was trying filepath.strip, but I keep getting an error filepath.strip is not a function. This is odd because I am copying it exactly from the documentation. Is this a bug with angular 1.5 and bard.js or is there more to setting up filepath.strip
cacheIdFromPath: function (filepath) {
//console.log('filepath',filepath);
//var cacheId = filepath.substring(filepath.indexOf('/Templates'));
//console.log('cacheid',cacheId);
var cacheId2 = filepath.strip('Templates/', ' ');
console.log('2', cacheId2);
return cacheId2;
},
moduleName: 'templatesCached'
+1
filepath is just an ordinary string, so you should use something like filepath.replace.
Run into it too, pretty sure it's a typo. and they meant replace as burka said ^