3 ms·
Major issues I have with angular: 1. Doesn't play well with jquery. Digest cycles and event passing don't mix. With any significant jquery plugin you end up
by ascotan 12y ago
Major issues I have with angular:
1. Doesn't play well with jquery.
Digest cycles and event passing don't mix. With any significant jquery plugin you end up with $timeout(0) hacks (with or without the jquery being wrapped in a directive). Since jQuery is the foundation of pretty much everything, this is a torpedo that sinks the battleship. In addition, pulling in jQuery plugins (awesome ones!) requires a major hackathon of wrapping the code in a directive, figuring out why the events are always triggering, then throwing some $timeout(0) hacks in there. ship it!
2. No concept of M (model) in MVC/MVVC/MTV/M??
Data in the directives, data in the controllers, data in the services. oh my! Once your app reaches a certain complexity you'll be doing WTF's as to where a $scope.variable is actually being defined. (Oh i see it was defined in a controller inside a directive that was inserted into the DOM dynamically via a controller!?...)
3. When things go wrong you have to dig too deep
Want to make a recursive directive? Good luck reading the docs on the $compile phase. There are too many times that when something goes wrong with angular, you end up in a deep well of tears trying to figure out why it's not working. This creates a productivity problem.
Minor issues I have with angular:
1. DOM pollution
old schoolers see adding non-standard tags in the HTML as 'code smell' for the same reason that we no longer do 'onclick=alert('hi')'. Part of the reason that this stuff was replaced with $('id').click() was that it created tight coupling between the HTML and the dynamic code. By inserting non-standard tags into HTML which requires the use of a 'compiler' you are no longer separating the concerns of 'presentation', 'structure' and 'dynamic code'. I personally find it distasteful, however, I can live with it (like a stinky roommate).
2. Slow unit testing
One of the most touted features of angular is it's testability. However, 1) virtually every angular component out there has no unit tests and 2) testing directives and mocking out features is so time consuming that it brings development to a crawl. I find that the mix of time spent on testing vs coding is 50/50. That is that for 1 day of coding you'll put in a full day of writing unit tests. The reason is that testing angular is so complicated that it takes that long to get it right. Unit tests are always a good time investment, and that investment is not 0. However, if feel that a 50/50 ratio is too high. Testing should be faster to allow devs to be more productive.
3. Performance is easy to screw up
Reading some of the other comments I realized another minor issue. Performance in angular is great. However, because angular doesn't have any real organized (or patterned) way to create an app (you can make a controller or have a controller in a directive), you end in a situation where the way you have organized your code now creates performance problems. This is true in any framework and with some training can be avoided. However, it appears that the critical mass for this issue comes much sooner than expected due to the perl-like anything goes feel to application structure.