You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ivy: accessing undefined ViewChild properly with elvis operator in template breaks #34087
If I add a ViewChild decorator to an undefined component in a template and try and access it using the elvis operator in a template then the expression breaks and nothing is outputted in the template.
FYI @alxhub performed further investigation and fixed the problem in PR #34221 👍
The problem was that I looked at the JIT output and the problem was present in AOT output (which is now aligned with JIT).
Thank you.
Activity
AndrewKushnir commentedon Dec 4, 2019
Hi @mattlewis92, thanks for reporting this issue.
I performed the investigation and found out that the code generated by Ivy Compiler in a
templatefunction looks correct (compiled locally):and it looks like parentheses are removed after further processing (presumably in CLI):
Which changes the logic and makes the code return
null(and render nothing) instead of rendering 'bam' string.@filipesilva do you know if this is an optimization step in CLI that might affect this?
AndrewKushnir commentedon Dec 4, 2019
FYI @alxhub performed further investigation and fixed the problem in PR #34221 👍
The problem was that I looked at the JIT output and the problem was present in AOT output (which is now aligned with JIT).
Thank you.
mattlewis92 commentedon Dec 4, 2019
Amazing, thank you for looking into it so quickly! ❤️
fix(ivy): properly parenthesize ternary expressions when emitted
fix(ivy): properly parenthesize ternary expressions when emitted (#34221
angular-automatic-lock-bot commentedon Jan 6, 2020
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.