Open yuezhizizhang opened 6 years ago
Same for all custom elements, don't know is it ngx-translate or angular issue. I'm using translate pipe instead.
@yuezhizizhang Following the link below, https://netbasal.com/getting-to-know-the-ng-container-directive-in-angular-a97b7a33c8ea
<ng-container> is a logical container that can be used to group nodes but is not rendered in the DOM tree as a node.
<ng-container> is rendered as an HTML comment.
so this is expected result.
so this is expected result.
I'm not 100% sure. It's not because ng-container itself is not rendered and considerated a comment that a text node inside of it should be ignored. In other words:
<ng-container>something, whaterver it is, text or nodes</ng-container>
produces
something, whaterver it is, text or nodes
<!---->
A text node is still a node, a leaf to be more precise, it doesnt "disappear" because it's wrapped in a ng-container. The ng-container just allows to avoid to output a new node, like a span, that would just make the DOM heavier.
Current behavior
I have an element: <ng-container [translate]="'name'">Name
ngx-translate doesn't translate it. But If I change the element to span, it works.
Expected behavior
ngx-translate should be able to translate ng-container element.
How do you think that we should fix this?
Minimal reproduction of the problem with instructions
Environment