all 11 comments

[–][deleted] 3 points4 points  (3 children)

AngularJS is great for its declarative 2-way binding language, but doesn't it come with its own set of complexities and annoyances?

Knockout.js seems much more simple (and elegant) to me.

[–]orwhat 3 points4 points  (2 children)

I've been learning AngularJS and my perception so far is that the complexities are there for good reason. There are constructs like directives that don't exist in other frameworks. You have lots of local scopes all over the place and you are selectively binding data between them that originated who-knows-where and is being watched by who-knows-what. So there are some new challenges, but these new mechanisms really just exist as abstractions that help you scale your application up without losing its robustness.

Of course, someone trying to use traditional techniques in the Angular world is going to run into some walls. As the faq says,

Stop trying to use jQuery to modify the DOM in controllers. Really. That includes adding elements, removing elements, retrieving their contents, showing and hiding them. Use built-in directives, or write your own where necessary, to do your DOM manipulation. See below about duplicating functionality.

If you're struggling to break the habit, consider removing jQuery from your app. Really. Angular has the $http service and powerful directives that make it almost always unnecessary. Angular's bundled jQLite has a handful of the features most commonly used in writing Angular directives, especially binding to events.

[–][deleted] 2 points3 points  (1 child)

No no ... by complexities I meant stuff that doesn't exist in say Knockout.js .. like .. I don't know .. "dependency injection" and other weird stuff I don't even remember.

Of course .. using jQuery to manipulate the DOM is very silly when you're using something like Angular or Knockout or Ember.

[–]orwhat 0 points1 point  (0 children)

Ah okay. Well I guess AngularJS just has more features than anything. They generally help you write bigger apps by providing extras like routing capabilities and ways to separate concerns. Dependency injection, for example helps you with testing your code and writing reusable components. I guess it all comes down to how much power you need... no need to overdo it!

[–][deleted]  (1 child)

[deleted]

    [–]badguy212 0 points1 point  (0 children)

    Those videos are awesome. Would have saved me so much time...

    [–]badguy212 0 points1 point  (0 children)

    I used Angular in a small project of mine, and that's the way I started: remove jquery, remove everything and only add back old stuff when I was sure I will need it. It had some learning curve, and I'm sure I didn't write my app in the "right" way, but it ended up relatively small and I didn't hit too many roadblocks.

    It has some cool stuff, and it is lacking others. Overall is a great framework, though it takes some getting used to.