Replies: 2 comments
-
As for me, I would go with such mindset:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Nice one Eugene! I like it. Thanks for sharing it.
… On 14 Jan 2022, at 23:54, Eugene ***@***.***> wrote:
As for me, I would go with such mindset:
If component has root element - it's absolutely OK to put directive there. Don't see any sense in adding one more ng-container just for fun
If component HAS NO root element and I need to translate whole component - then ng-container is a good deal
Finally, sometimes if there is component where part is translated and part is not - I guess it's OK to wrap just translatable part - just to indicate 'hey, we do translate here'. But for most of cases I'd go with #1 and #2.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I have a question about the structural directive. Where should I put it? Should I bubble it up to the uppermost HTML DOM element that's the common ancestor for all the places where there are translations and calls to
t()
? Or should I simply add it blindly in each component that uses translations in a <ng-container *transloco="let t;">`...?What's the best practice? Do you place them? Do you enclose your component HTMLs with an
<ng-container *transloco="let t;>
? Do you have multiple of those directives within the same HTML template?Beta Was this translation helpful? Give feedback.
All reactions