In React there are a lot of packages for managing ternary operators for conditionally rendering some UI parts. It's really easy to even create such components by yourself.
I am sure that Angular also can have such approaches. Even if it is hard to find such kind of components I think it's better to move the conditional statement to Component file for making the code cleaner and more readable.
Frontend Developer ❤️🔥 | Just learning, practicing, coding and letting a little bit of it spread out forever and ever ➿ Be brave enough to be bad at something new!
Wow, really cool and interesting. I also like to keep everything well componentized to avoid duplication and make maintenance easier. Thanks for sharing!
In React there are a lot of packages for managing ternary operators for conditionally rendering some UI parts. It's really easy to even create such components by yourself.
I am sure that Angular also can have such approaches. Even if it is hard to find such kind of components I think it's better to move the conditional statement to Component file for making the code cleaner and more readable.
Attaching some packages for React.
npmjs.com/package/react-if
npmjs.com/package/react-conditiona...
P.S. If you wish I can share my own written solution for such kind of problem.
Wow, really cool and interesting. I also like to keep everything well componentized to avoid duplication and make maintenance easier. Thanks for sharing!
Please, I'd love to see your solution!
Pushed the solution to GitHub.
Feel free for any kind of comments.
github.com/alexandermirzoyan/rc-co...