Reputation: 75656
Is it possible to remove or disable the HTML comments angular produces?
<ol class="items">
<!-- ngRepeat: item in list | orderBy:'time':true -->
</ol>
Its breaking CSS rules that use :empty
pseudo class.
ol:empty {
content: "No results";
}
In order for the rule to be applied, there needs to be no whitespace or comments:
<ol></ol>
Upvotes: 7
Views: 3134
Reputation: 69
$compileProvider.debugInfoEnabled(false);
But it can broke some plugins which have references on angular comments.
Upvotes: 2
Reputation: 75656
I ended up adding a class .empty
with ng-class="{ empty: !list.length }"
and applying the CSS rule that way without relying on the pseudoelement :empty
.
Upvotes: 3
Reputation: 16
The content property is used with the :before
and :after
pseudo-elements
Upvotes: 0
Reputation: 10182
While not the most efficient or direct way to do it, you could use javascript to remove the contents of the elements. Something like this should work:
document.getElementsByClassName('items').innerHTML = "";
I don't know what kind of structure you have, but I'm sure you could sneak this in before the CSS is loaded...
Edit
After reading the post linked by @zsong and this post here, you might end up breaking Angular trying to do this. Only one way to find out I guess!
Upvotes: -1