Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I use 'if' statement with interpolation? #1248

Open
ElDelOtroDia opened this issue Sep 14, 2020 · 0 comments
Open

Can I use 'if' statement with interpolation? #1248

ElDelOtroDia opened this issue Sep 14, 2020 · 0 comments

Comments

@ElDelOtroDia
Copy link

Current behavior

My es.json file is:
"turn": "Turno: {{ morningTurn ? "MATUTINO" : "VESPERTINO" }}"

How I'm calling it in html:
{{ 'turn' | translate: {morningTurn: (morningTurn) }} (morningTurn value should be 'true' or 'false' depending on some conditions)

How is this represented in html view:
Turno: {{ morningTurn ? 'MATUTINO' : 'VESPERTINO' }}

Expected behavior

I was soecting my html view something like:
Turno: MATUTINO
or
Turno: VESPERTINO

What is the motivation / use case for changing the behavior?

I want to show that information depending on the hour of the day, sending a boolean value if the actual hour is between some range

How do you think that we should implement this?

I don't know if there's a better way to implement this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant