ericclemmons / grunt-angular-templates

Grunt build task to concatenate & pre-load your AngularJS templates
MIT License
711 stars 108 forks source link

HTMLmin is not fully compatible with Angular #82

Open MichielDeMey opened 10 years ago

MichielDeMey commented 10 years ago

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. :)

ericclemmons commented 9 years ago

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

brandon-arnold commented 9 years ago

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

brandon-arnold commented 9 years ago

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