r/javascript • • Nov 05 '14

AngularJS: The bad parts

http://larseidnes.com/2014/11/05/angularjs-the-bad-parts/
87 Upvotes

88 comments sorted by

View all comments

28

u/yelvert Nov 05 '14 edited Nov 05 '14

1 obj should be defined somewhere in JS not just HTML, if for no other reason than clarity, if you do this both fields work exactly as expected.

2a Use the array/$inject declaration syntax

2b Use a build process you fool, ng-min solves your minification woes. You should ALWAYS have a build process anyways.

3 I work on an extremely large/complex angular app with 500-2000 active bindings at any one time, and have NEVER run into any issues at all with the digest loop. It is always extremely fast, even on slow computers.

4 Dont be a dumbass

5 Repeat #4

Edit. There IS one downside to angular scopes, and that is the need to occasionally/rarely using $parent in ng-model to force it to look into an "outer" scope, but I've found that whenever I run into this issue, its usually because I didn't design something right.

6

u/Poop_is_Food Nov 06 '14

At this point, I imagine some readers are eager to tell me how to avoid the above problem. Indeed, when you know about the problem, you can avoid it. The problem is that a new Angular user likely does not know about the problem, and the default, easiest thing to do leads to problems.

Angular is ok if you know it well and all of your team members know it well. But if you have to bring on some people to help out in a pinch, and they havent already crested the huge learning curve, then you're fucked.

1

u/yelvert Nov 06 '14

Not true at all. Several months ago we had a data guy, with no programming experience, that was coming to me all the time to help improve his admin interface. We had already moved our main app to angular from backbone and had not started the admin migration. I took a day and setup the base framework for the new admin app, and showed him the full app code to learn from, 3 days later he had 2 of the admin areas done. Sure he made a few mistakes, but it was all there and worked well.

2

u/Poop_is_Food Nov 06 '14

wow that anecdote about your CRUD app negates my entire point.

1

u/yelvert Nov 06 '14

Ha, a bit more complicated than that. Those are staying in backbone ... for now.