r/angularjs • • May 25 '16

Some complaints about angular2/angular-cli

https://gist.github.com/NullVoxPopuli/82ee489121fcc21a0e80aaf88559dada
9 Upvotes

29 comments sorted by

View all comments

Show parent comments

6

u/gonzofish May 25 '16

Also, why does everyone think they have to inline their templates? You can do templateUrl...

2

u/DerNalia May 25 '16

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...

1

u/DecentOpinions May 25 '16

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.

1

u/[deleted] May 31 '16 edited May 31 '16

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