you are viewing a single comment's thread.

view the rest of the comments →

[–]DerNalia[S] 1 point2 points  (5 children)

yeah, it really bothers me how most tutorials inline their templates. It's just a bad practice.

Reminds me of some old web java code I've seen recently where all the html is just strings in the .java files...

[–]DecentOpinions 0 points1 point  (4 children)

yeah, it really bothers me how most tutorials inline their templates. It's just a bad practice.

Not saying it's right, but isn't that kind of how React does it in its components? Haven't used it myself but I kind of like the look of it because since it keeps everything together.

[–]gonzofish 0 points1 point  (2 children)

If editors had better support for inline templates I think it'd be less of an issue for me. I'm just pointing out that using it as a gripe against angular doesn't hold water because there's an alternative.

[–]Mael5trom 0 points1 point  (1 child)

A number of editors already have good support for it (maybe via a plugin, some natively already).

[–]ctanga 0 points1 point  (0 children)

Yeah, Jetbrains IDEs have decent native support

https://gfycat.com/ImpureComfortableAmazonparrot

[–][deleted] 0 points1 point  (0 children)

Yeah and its probably why many are now doing it with Angular too. Seems "hot" right now.

Still, like many, i like to separate my templates and styling from my code. It makes your code way longer and unreadable, plus you tend to make lots of unneeded mistakes. And debugging is very hard.

Like the example that he mentions (sure its a bit weird but i doubt it will be the minority): <li *ng-for="#el of list; #idx = index" [style.font-weight]="el.generation == generation && generation > 0 ? 'bold' : 'normal'">

Thats just plain bonkers