grunt-angular-templates icon indicating copy to clipboard operation
grunt-angular-templates copied to clipboard

HTMLmin is not fully compatible with Angular

Open MichielDeMey opened this issue 10 years ago • 3 comments

Hi

I'm just letting you know that html-minifier (https://github.com/kangax/html-minifier/), which is used by grunt-usemin is not fully compatible with AngularJS.

AngularJS has support for inline JSON, but html-minifier actually escapes inline JSON. Please see Issue 98 for more information on this. (https://github.com/kangax/html-minifier/issues/98#issuecomment-33257867)

A way to work around this is simply by not using the htmlmin option in the ngTemplates grunt task. As of now, there is no option to configure this.

You might want to document this behaviour. :)

MichielDeMey avatar Mar 04 '14 20:03 MichielDeMey

I'm going to remove htmlmin. What a PITA that "feature" has been.

ericclemmons avatar Dec 22 '14 15:12 ericclemmons

Second removing the htmlmin feature. I discovered that it was removing the type="text" attributes from all input tags in my templates!

brandon-arnold avatar Jan 25 '15 15:01 brandon-arnold

Specifically, it's the removeScriptTypeAttributes option. But they aren't script type attributes; they're input type attributes. Seems a little buggy.

brandon-arnold avatar Jan 25 '15 16:01 brandon-arnold