This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Transcluded content is not trimmed #15077
Closed
Description
When specifying an ng-transclude
element, the documentation says you can provide a fallback that will render if no content is transcluded. However, if there is only whitespace in the transclusion slot it will replace the fallback with this whitespace.
I prefer to markup my components as follows:
<ns:legend-item
ng-repeat="item in $ctrl.legendItems"
ns:color="{{ item.color }}"
ns:label="{{ item.name }}">
</ns:legend-item>
Doing it this way means it always passes some whitespace as the transcluded content and my fallback is removed. To fix I have to change the markup to:
<ns:legend-item
ng-repeat="item in $ctrl.legendItems"
ns:color="{{ item.color }}"
ns:label="{{ item.name }}"></ns:legend-item>
It doesn't seem right that the position of the closing tag changes how the component renders.
I'm using Angular 1.5.5.