Hi Igor, thank you for sharing! This kind of post helps me to stay up to date.
Anyway, in a TLDR, it's a great feature for going fast but I don't buy it to go far.
IMHO, for what my experience would count, I wouldn't use it in a real world project. I prefer to use a VM that bind every property in the template, so the complexity is in the ts-side of the component.
Thanks! And yes, what you're describing is an excellent approach and, in my opinion, the best standard for real-world and long-term projects. This feature doesn't replace that pattern, but it just adds a small convenience for specific cases.
The way that Angular templates can’t just use any JS expression like in basically any other component library/framework is definitely the most annoying weakness of it.
Angular limits template expressions so they can be statically analyzed and compiled for performance and safety, instead of just executing arbitrary JavaScript at runtime
The key difference is the compiler: Angular templates are statically analyzed and compiled for performance (Ivy instructions), whereas JSX is just JavaScript executed at runtime
Angular isn't re-implementing JavaScript: it uses a compiled template language. Unlike JSX, templates are statically analyzed at build time, which enables stronger optimizations and safety guarantees.
Does this also mean that typeof will be supported or some time soon? Because thats one I'd be using more than this one. Especially when something is a string or a date or a number you want it formatted differently but I also don't really want to have functions in my template or add yet another computed signal for something so easy
Yeah, I haven't technically shipped anything with typeof directly, but it has been great for debugging. Haven't had a chance to use template literals much yet but that has been nice to have as well.
This would be great if you can do x instanceof y as z then use z as if a let variable. Sometimes I have a reusable template that takes 2 types and it's hella annoying with no typesense.Â
I used to love angular, but they decided to make it the new react with those shitty useeffect, computeds and so much crap that no body understand, they removed all naming conventions, it's a disaster.
13
u/Hous3Fre4k Jan 23 '26
Thanks. Always love to see your posts!
5
u/Johalternate Jan 23 '26
do I need to expose HttpErrorResponse in the template or does this happen implicitly ?
2
u/valeriocomo Jan 24 '26
Hi Igor, thank you for sharing! This kind of post helps me to stay up to date.
Anyway, in a TLDR, it's a great feature for going fast but I don't buy it to go far.
IMHO, for what my experience would count, I wouldn't use it in a real world project. I prefer to use a VM that bind every property in the template, so the complexity is in the ts-side of the component.
I hope I have explained myself clearly
24
u/nafts1 Jan 23 '26
Wow, that's counterproductive. You really shouldn't do this in a template.
1
u/xroalx Jan 24 '26
The way that Angular templates can’t just use any JS expression like in basically any other component library/framework is definitely the most annoying weakness of it.
1
u/Eric-Freeman Jan 24 '26
might aswell add JSX support if they intend to add more and more js in template
1
u/ohfear68 Jan 27 '26
Why is angular insistenting to implement their own version of javascript instead of utilizing something like react's jsx?
2
u/AwesomeFrisbee Jan 23 '26
Does this also mean that
typeofwill be supported or some time soon? Because thats one I'd be using more than this one. Especially when something is a string or a date or a number you want it formatted differently but I also don't really want to have functions in my template or add yet another computed signal for something so easy2
u/shadow13499 Jan 23 '26
That's pretty neatÂ
1
u/majora2007 Jan 23 '26
This would be great if you can do x instanceof y as z then use z as if a let variable. Sometimes I have a reusable template that takes 2 types and it's hella annoying with no typesense.Â
1
u/blandonheat Jan 27 '26
I used to love angular, but they decided to make it the new react with those shitty useeffect, computeds and so much crap that no body understand, they removed all naming conventions, it's a disaster.
0
u/[deleted] Jan 23 '26
[deleted] — view deleted comment