TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What's the problem with AngularJS?

10 pointsby someguy1233over 10 years ago
Seems a lot of people here are starting to push it away for other technologies, mostly ReactJS which I struggle to see how the two frameworks are even alike.

9 comments

quadratiniover 10 years ago
Angular abstractions leak everywhere: <a href="http://stackoverflow.com/questions/18826320/what-is-the-hashkey-added-to-my-json-stringify-result" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;18826320&#x2F;what-is-the-hash...</a> <a href="http://stackoverflow.com/questions/16935766/run-jquery-code-after-angularjs-completes-rendering-html" rel="nofollow">http:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;16935766&#x2F;run-jquery-code-...</a> &lt;- &quot;You might need this timeout to be sure its run after DOM render.&quot; wat<p>- You have to do everything the &quot;angular way&quot;. Timeouts, intervals, http, modules, angular.toJson. It&#x27;s a pain. Why can&#x27;t I use the regular setTimeout, or ES6 or Common JS modules, or JSON.stringify?<p>- You end up having to dig inside the source code to debug issues with Angular.<p>- You basically HAVE to understand the digest cycle.<p>- Its way of doing templating is crippled in the sense that it&#x27;s not as expressive as javascript.<p>- Honestly I think it&#x27;s for people who doesn&#x27;t like javascript and its ecosystem (npm).<p>React isn&#x27;t alike angular because that&#x27;s the point. React embraces javascript whereas Angular doesn&#x27;t. If you want a http library use one of your choosing from npm, like axios. You want to use Common JS modules? Go ahead.
评论 #8993224 未加载
评论 #8995145 未加载
jf22over 10 years ago
Angular is popular and anything that&#x27;s popular gets criticized heavily.<p>Most of its criticisms are from people who don&#x27;t fully understand angular and that&#x27;s to be expected. Usually you can find issues with anti-angular rants that would apply to any javascript framework or large library.<p>Angular provides a very broad set of tools that takes a while to fully appreciate and learn. Of course React or Flux or something else will be &quot;better&quot; than angular at something or other because Flux and React are very specialized frameworks that do one thing very well.
KukicAdnanover 10 years ago
AngularJS is a fine framework. Like any technology it has it&#x27;s positives and negatives. The biggest issue people seem to have with Angular at the moment is that the upcoming Angular 2 is a complete rewrite of the framework and the angular team isn&#x27;t sure if there will be an upgrade path from the current versions.<p>I&#x27;ve used Angular for both prototyping and in large enterprise applications and it&#x27;s served me well personally. It takes a bit to get used to the angular way of doing things but once you learn it - it&#x27;s as good as any framework.
skylarkover 10 years ago
The problem with internet discussions is that the raw number of people who have informed opinions are low compared to the number of people who want to participate in a given discussion.<p>Because of this, many people end up parroting the ideas they&#x27;ve heard from others without having the proper context or nuance in their arguments that you would normally get through actual experience.<p>The truth of the matter is somewhere in the middle of &quot;Angular.js is good&quot; and &quot;Angular.js is the second coming of Satan.&quot; That truth probably lies closer to &quot;Angular.js is good&quot; than the general consensus on the internet would lead you to believe.<p>At the end of the day, take internet opinions as just that - opinions, and try to form your own conclusions.
whichdanover 10 years ago
For React, you should be comparing React + Flux to Angular.<p>The biggest problem with Angular is that it has a <i>very</i> steep learning curve, and writing bad Angular code is worse than writing bad jQuery soup.<p>- Using watchers&#x2F;observers are encouraged, which makes control flow impossible to read for sufficiently complex pages. It effectively creates a potential side effect on any variable that can&#x27;t easily be traced, and multiple watchers can casacade changes to eachother.<p>- Because of the way watchers&#x2F;events work, Angular&#x27;s digest loop implements a TTL, where it will keep evaluating watchers&#x2F;events until there are no more changes, with a hard stop at $TTL+1. While this solves a lot of problems, it can make it very difficult to monitor state changes in the view, when a console.log&#x2F;debugger&#x2F;breakpoint will get triggered ten times as often as you&#x27;d expect.<p>- Angular has a <i>lot</i> of terminology[1], and each concept has its own set of idiosyncracies. When you combine this with the additional bootstrapping logic in Jasmine (and things like isolateScope), it ends up being very complex for a developer&#x27;s first framework.<p>- Parent&#x2F;Child relations in Angular are inferred from the structure of the DOM. This means you need to read your templates to figure out how your app is structured, and you&#x27;ll end up with tight coupling unless you&#x27;re diligent about your design decisions.<p>- It&#x27;s very easy to let a lot of view logic slip into ng-bind and similar attributes. All of this logic should be extracted into objects and unit tested, but this means that a lot of the convenience of using Angular&#x27;s declarative syntax end up being minimal at best.<p>- Like any framework -- expanding on what #quadratini said -- you need to use Angular&#x27;s built-in libraries to do anything. While the syntax is reasonably similar, $timeout, $interval, $http, $q, etc all need to hook into the digest cycle, and this means you&#x27;ll be wasting time figuring out when to call $apply or when to wrap a piece of code in $timeout just to get it to play nicely with Angular.<p>Angular is very powerful and not necessarily a bad framework, but based on my experience using it in a team environment for the past year and a half, unless everyone is senior-level at Javascript, you&#x27;re going to quickly end up with a lot of hard to maintain, mediocre code.<p>[1] <a href="https://docs.angularjs.org/guide/concepts" rel="nofollow">https:&#x2F;&#x2F;docs.angularjs.org&#x2F;guide&#x2F;concepts</a>
hasenjover 10 years ago
It&#x27;s a framework, it tries to do everything, but it does a half-assed job at most of them.<p>It has its own module system, but it&#x27;s half-assed.<p>Its architecture is a mess; not simple, not easy to understand.<p>So many people adopt it just because it&#x27;s from Google, and then these people find themselves fighting with the framework and having to ask tons of questions, so you get these statistics that seem to imply &quot;lots of people are talking about Angular&quot;, so more people jump on the bandwagon .. and so on.<p>Personally I recommend Knockout.js + Require.js + Durandal + rsvp.js (for Promises).
y0ghur7_xxxover 10 years ago
I see no problem with Angular, but at the moment 1.x is dead tech, and 2.x is not here yet. So it&#x27;s difficult to start a new project with Angular without feeling a bit nervous.
评论 #8993178 未加载
JohnMunschover 10 years ago
The level of FUD here is astounding. AngularJS is not perfect, nor certainly are the major competitors. React seems to be dribbling out a piece at a time to us and each piece gets its own name and arrives in its own time. That makes it a little bit difficult to use as a framework. Hopefully it will all eventually jell and provide a really different take on how to build the front-end. I&#x27;d love it if there was a third choice with the same level of support behind it out there to give both of them a run for their money.<p>But this is reality here: <a href="http://www.google.com/trends/explore#q=angularjs%2C%20ember.js%2C%20backbone.js%2C%20reactjs%2C%20durandal%20js&amp;cmpt=q&amp;tz=" rel="nofollow">http:&#x2F;&#x2F;www.google.com&#x2F;trends&#x2F;explore#q=angularjs%2C%20ember....</a><p>See those lines hugging the bottom of the chart? They&#x27;re everything that isn&#x27;t AngularJS and React. React is clearly on the uptick and AngularJS on the downtick for the partial Feb data they&#x27;ve got, but everybody else is in the noise level.<p>Yet people here would have you think:<p>1: It&#x27;s old! - Really? 1.0 shipped in mid 2012. In three years we will have gone from 1.0 to 1.4 and some work done on 2.0.<p>2: It&#x27;s going to change tomorrow when 2.0 comes out. - Really? Have you spoken to the other guy just above? He seems to think it&#x27;s decrepit, you&#x27;re worried that anything you build with it will have to be thrown away tomorrow because of its astounding rate of change.<p>3: Using the Chinese menu system of putting together a front-end framework is perfectly viable. Just pick something from columns A&#x2F;B&#x2F;C&#x2F;D and throw it together and start using it. You&#x27;ll find lots of people who can answer your questions, there are books written on that particular combo of tech, and there are developers out there by the hundreds you can hire who will have no problem diving right into your projects.<p>No. It doesn&#x27;t really work that way. Pick an arbitrary grab bag of stuff and maybe you&#x27;ll make some excellent choices. But you&#x27;ll have to live with that decision for quite a while. Even a less popular stack like Ember.js is going to get more third party support than whatever you decide upon for yourself.<p>Above all, please do a quick experiment for me. The next time somebody tells you that AngularJS is a dead end and you can&#x27;t rely on it for years to come, ask them what they would have recommended back in 2013? Just two years ago. What set of stuff would they have advocated then that would be doing so well today and have this long lived future into 2017+ that wasn&#x27;t AngularJS? Backbone.js? I don&#x27;t know of anything.<p>My point is this, the front-end and JavaScript tech is changing at a rate way too high for anyone&#x27;s predictions about two and three years down the road to have a lot of merit. AngularJS seems like a reasonable bet to have done well and have lots of info available about migration from 1.X to 2.0 so at the moment I&#x27;m still on that path. In the meantime I hope to learn more about Facebook&#x27;s stuff to see if it gives me useful ideas or to see if I can incorporate parts of it into AngularJS (Flux seems interesting for instance and would likely slide into most of the frameworks). But the people below who speak with such certainty about the future... Maybe they don&#x27;t see it as clearly as they think.
cmstokenover 10 years ago
AngularJS is not a great framework. In fact, it&#x27;s a horrible framework. You should really be using ReactJS. It&#x27;s leagues ahead and much more robust. BTW, Angular is also getting old.