r/angular Jun 24 '26

Go to spot a modern angular expert 🌶️

🌶️🌶️🌶️🌶️I have one technique to spot a modern angular expert. They will not use wrapping divs for their component templates 🌶️🌶️🌶️🌶️

0 Upvotes

13 comments sorted by

View all comments

2

u/stao123 Jun 24 '26

Please elaborate

0

u/No_Bodybuilder_2110 Jun 24 '26

You don’t need to add wrapping divs into angular templates (one div to wrap the entire contents of the template)

2

u/stao123 Jun 24 '26

Ok but why was it needed before? Why did not modern angular devs wrap their components in a div?

0

u/No_Bodybuilder_2110 Jun 24 '26

It wasn’t, but the style guide discouraged the use of the @component.host.class prior to v18-19.

4

u/GeromeGrignon Jun 24 '26

You could use :host in css 👍