Skip to content
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
@jjenzz

Description

@jjenzz

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions