text-overflow
only has an effect when the overflow
property is different from visible
.
Also, max-width
does not apply to non-replaced inline elements (spec), which span
s are by default. Example working code:
.ellipsis {
max-width: 3em;
display: inline-block; /*enables max-width and overflow properties*/
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Now apply the class to the element:
<div ng-repeat="your loop directive">
<span class="ellipsis">{{something}}</span>
</div>