karma-ng-html2js-preprocessor
karma-ng-html2js-preprocessor copied to clipboard
Partials encoded with unicode+signature produce junk prefix
For most text encodings, ng-html2js will produce an entry in the template cache containing a properly encoded string.
However, I found in the past that when using templates encoded with UTF-? + signature, the templates retain their signature when pushed into JS. So each template comes out prefixed with \ufeff. This causes no errors until trying to use the template, where angular would produce the "Uncaught SyntaxError: Unexpected token" error referred to here.
Testing again after updating shows that ng-html2js still retains the junk signature, however it no longer causes issues in most browsers. I am testing on IE8, IE10 and Chrome and only IE8 errors with "Template must have exactly one root element".
The easy solution is just to encode your files without UTF signature, but it's still a bug I guess - either in ng-html2js or in node's file libraries.
Details: OS: Windows Server 2012 Node: v0.10.12 ng-html2js: v0.1.0 karma: 0.10.8 angular: 1.1.4 Signature erroneously appears in: IE8, IE10, Chrome (all I have tested) Causes issues using the template in: IE8 only