karma-ng-html2js-preprocessor icon indicating copy to clipboard operation
karma-ng-html2js-preprocessor copied to clipboard

filepath.strip is not a function

Open winnemucca opened this issue 9 years ago • 3 comments

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'

winnemucca avatar Mar 11 '16 15:03 winnemucca

+1

Steve-Mc avatar Apr 18 '16 10:04 Steve-Mc

filepath is just an ordinary string, so you should use something like filepath.replace.

burka avatar Jun 08 '16 13:06 burka

Run into it too, pretty sure it's a typo. and they meant replace as burka said ^

akras-apixio avatar Jul 29 '16 21:07 akras-apixio