I tried using display: inline-block
but it changed the look of the label padding in Bootstrap 3.

So I investigated a little further. The issue is that there is no space between the labels, so there is nothing to wrap on. An easy fix is to enclose the label in another span and put a space before or after the inner span.
<span ng-repeat="a in data.tags">
<span class="label label-primary" style="margin-right:5px;">{{a.tagName}}</span>
</span>
The whitespace due to formatting in front of the inner space suffices for a wrapping point. If you were to put it all in one line, you'd need to add a conspicuous space.
<!-- _ conspicuous -->
<span ng-repeat="a in data.tags"> <span class="label label-primary" style="margin-right:5px;">{{a.tagName}}</span></span>
Without the space above, the labels will not wrap.
I also tried various ::after { content: ' '; white-space: normal }
strategies. Putting that on the label itself did trigger wrapping, but it cuts off the end of the label that wraps. It still required an outer span to be visually correct. Although at least with a class, it is explicit that the container's purpose is to trigger wrapping:
<style>
.wrappable::after { content: ' ' } /* content: '' wraps too */
</style>
<span class="wrappable" ng-repeat="a in data.tags"><span class="label label-primary" style="margin-right:5px;">{{a.tagName}}</span></span>
Reasons
It's a bit annoying that you have to change the structure of your document to get this obviously expected result. However, I believe this is a consequence of the labels themselves being white-space: no-wrap
. (There is good reason for labels to be set this way... otherwise, words inside a label could break across lines.) The browser sees a bunch of no-wrap elements with no breaking space between them. So it makes a logical conclusion that the elements should not be broken up at all. The alternative to make labels render "correctly" is to make labels a multi-element structure (which is what the above is doing) to encapsulate the non-wrappable element in a wrappable one. But this is not ideal because the container element would be redundant in many cases.