Closed canebat closed 9 years ago
Just tested and it seems to work fine, in this specific case you probably need new Minimize({ empty: true, spare: true });
. empty
will make sure the value attribute is added , e.g. <option value>
and spare
will add ""
making sure the value attribute keeps it empty value <option value=""
>. Having just empty: true
might cause the browser to optimize the attribute away, cause normally value is not a boolean attribute.
To make sure this is not some edge case bug, what version of minimize are you working with and what browser are you working on?
Adding spare: true
like you suggested worked for me.
I'm using chrome, minimize 1.4.1.
My html is actually using angularjs:
<select ng-model="item">
<option value="">Select something</option>
<option ng-repeat="i in items" ng-selected ="item == i.name>{{ i.name }}<option>
</select>
the options will change to
<option>Select something</option>
even if I setminifyHTML({empty: true})
.Shouldn't be left as
<option value="">Select something</option>
?