I used Angular at my last company. After having used react for many years and then experimenting with svelte, Angular (even the most modern versions) felt like it was always in my way.
Bi-directional data binding and the isolation between style, structure, and logic felt was less productive. Angular has some nice properties, like dependency injection built in, but you can circumvent many of those needs with a functional component tree in react (or limit the surface area across components). The simple fact that you need @Output event emitters to handle callbacks is a good example of how bloated it feels.
It may be that I don't know nearly enough about Angular but even after a year of doing my best to learn the idiomatic Angular ways I wasn't impressed.
I really don't like Angular (mostly down to dependency injection, issues I had getting some of the components to work with mobile and it's markup ngAttributes mess) and it put me off React until recently. React is superb and a really new way of thinking about user interface components.
I used Angular for ~8 months on a project. It was just about ok. Much, much better than AngularJS (Angular 1.x). But worse than React in pretty much every way. What other people have said about everything needing to be mediated by the framework was the worst bit. That and making the change detection work correctly required understanding the internals in quite a bit of detail. React's approach is slightly slower but much simpler.
I haven't "mastered" React by any measure, but I've been using Angular for quite some time, and I find that apps written with it become really frustrating to maintain after a certain amount of complexity. I see Angular somewhat akin to C++ in that it's the most powerful and flexible (IMO) of the popular JS frameworks, but you're also going to spend a hell of a lot of time creating your own structure and conventions. This is a fine tradeoff if you need the flexibility, but for my use cases, React is much simpler and less headache-inducing to use. I just find that I can fit React's model into my head, whereas with Angular I'm constantly needing to figure out how to translate my mental model of my app into code that actually works, and dealing with weird, undocumented edge cases.
Angular was nice because two way data binding greatly simplified a lot of user-interface management code, and dependency injection made it easier to cleanly factor your code. Unfortunately, the boilerplate involved in creating directives tends to result in monolithic html templates that do way too much (and are hard to maintain), and the digest cycle/dirty checking ends up causing a lot of issues when things get complicated.
React makes it easy to create small components, encouraging maintainable, reusable software. On the flip side, passing data around in your application is a lot of work, and even the best current solution (unidirectional data flow with something like Redux) is very oblique and involves significant boilerplate.
In my opinion the React/Redux model is pretty good, and the libraries are well designed, there is just a need for a good framework to deal with the indirection involved in unidirectional state flow. I'm currently working on something in this space, it just needs some additional battle-testing so I can settle on the interface and work out all the kinks.
There are some things Angular does do far better than React IMO - Angular’s pain points are frustrating to me in terms of how I prefer to code though, largely due to its choice of supporting TS first and TS’s issues with toolchain integration/perf & not very conducive to FP, but it also has less pain in some respects such as when it comes to state.
I disagree (about never going back) - I spent some time playing around with React (I authored https://github.com/wesleycho/angular-react ), and I found the lack of a framework for application development to be a massive void. Code organization and modularity is becoming an increasingly important problem with JS as more logic is happening in the client and more components need to be modular for fast changing requirements. Neither Angular or Flux quite solves this, but Angular provides more useful tools for managing an application.
Angular has a void with the lack of a useful enough eventing solution - $scope eventing has specific use cases, but you don't want to use it as a general event bus, mainly due to performance. This is important for Angular since you don't want to couple modules together with hardcoded state keys that you may want to alter in different applications.
Flux does offer a way around the eventing problem at a lower level within React components, but on a higher level, there is no application level of control - you have to construct exactly the control you want, which while liberating, also is an easy way to create a hole in architecture when designing an application if you're not careful. Angular exposes that problem directly in many ways (for example handling transitions between two urls in the application), as well as forces thinking about module dependencies with dependency injection.
HTML mixed in with JS via JSX is also an abomination, that originally made me want to run far away from React when I first looked at it. I'm not a huge fan of it still, but it's not an extremely terrible thing as long as you keep higher level templates slim, which React forces you to do in order not to have huge chunks of HTML mixed in with complex JS...although I'm sure there are developers out there who do it anyway (just like there are plenty of Angular developers who will toss plenty of jQuery in an Angular controller).
I've used both for non-trivial apps. I find angular heavily over-engineered. The problem is not just the learning curve, but the fact it becomes almost impossible to do anything the framework authors didn't envisage. React is just plain functions so you can do whatever you want, it never got in my way.
Now, if angular would prove substantially better in terms of performance or maintainability or so, that might've been ok. But they're not. Performance is on par, I find refactorings actually harder because of the heaps of boilerplate angular requires, etc. They invented way too complex solutions to solve problems that either don't exist, or other frameworks solved better.
I find Angular much easier to reason about than the current state of React/Next. Which is funny because the biggest criticism of Angular years ago was its learning curve. Yet React seems to have become even more convoluted.
Angular is much much more than React, so no apples to apples, it is a complete kick ass awesome framework. I have used it in banking applications, mobile app and working on a startup which employs angular. I looked at backbone and angular is pure productivity, nothing else. I am not trying to learn the javascript nitty gritty and angular gets a whole lot more done in a lot less time and effort. React seems similar to EXT-JS widget toolkit and though seems similar to angular is more verbose. I admire the work Misko and team has done on angular and I am hoping it cleanly rolls and provides a abstraction or path forward when web components go mainstream. All in all i am not going to try any other lib unless Angular is not solving my problem. To hell with the purists.
I'm coming back to JS development after several years away and my first impressions of Angular are that it seems very complicated and over-engineered, with a lot of fairly abstract concepts to digest to get even simple things working. React.js seems so much simpler but there does seem to be a lot of community support for Angular.
Should I invest the time and learn Angular or go with React instead? Web components seem likely to change the whole web development landscape but my impression is that they're not quite ready for prime time yet.
I worked with React almost exclusively for ~5 years. I got so fed up with everyone reinventing the wheel on every project, coming to Angular (late) was a massive breath of fresh air. I now spend more time building valuable features rather than discussing changing state management libraries and people banging on about hooks all day long. YMMV, and I'm certainly in the minority, but I'd probably choose Angular over React for any new projects now, personal or professional. The only thing I really miss is that JSX is much more ergonomic and the devtools for React are a bit better.
Used angular for 2 years at work, and for a bunch of personal stuff. Now I'm trying out react, and even though it uses 10-100x as many lines as angular to do simple things. I'm hoping that for more advanced systems it will be on par, with better modularity and maintainability.
Performance is a + with react. Even though you can build performant systems with angular, it just seems to come more natural with react.
Good points, but angular has the very real drawback of useless terminology (transclude?) and a lot of wheel-reinvention (the several strange types of components). It's a pretty standard observable framework dressed up with a bunch of unnecessary hocus pocus (and pretty bad performance).
I've strongly disliked angular as long as I've been able to code. On the other hand, I like react a lot even though it has a similar learning curve. React may have strange and unfamiliar concepts, but they are actually new concepts in ui development that make things less error prone, very performant, and cross platform.
If the angular team was not funded by Google, I doubt any of them would be working on it any more. Actually, with angular 2, that's the case anyway.
If you don't like dom-diffing frameworks, maybe check out vuejs. This is an observable framework like angular, but it's performance is acceptable and its api is very clean and makes sense.
I'd offer the opposite perspective: I started a recent app in React, and I wish I'd stuck with Angular.
The core of the React render model is beautiful. It's far quicker to start writing and using a new component in React than in Angular, and the functional nature of React components feels good and highly productive. At first.
But the problem is, around that beautiful core, the React community has built a mass of libraries, meta-frameworks, techniques and practices that are decidedly less beautiful. After a while, I really found myself missing features from Angular, and struggling to replicate them by wiring together a hodge-podge React++ framework. Instead of being productive, I was wasting an inordinate amount of time trying to discover what the current micro-framework de-jour was for handling a particular problem in React.
For example, Angular supports view encapsulation. So you can write CSS targeting a component, and the framework will ensure that the style rules you write apply only to the HTML rendered by that components, without leaking to other parts of the app. This really is a godsend for properly isolating components in a reusable way. With React, there's a myriad of libraries for doing CSS, but most seem to be abandoned, and none seem to offer as straightforward or as easy style encapsulation as what Angular provides out of the box.
It was a similar story with forms. Which are a rich, reactive API in Angular, but seem to be an afterthought in React. And with dependency injection, both of singleton services and components elsewhere in the hierarchy.
I expect if you go all in on Redux, you can eventually build up a reasonable facsimile of what Angular provides. But from a standing start I think Angular is a much more productive framework, just because it's actually trying to be a framework, whereas React seems to be stuck somewhere between being a UI library and a framework, leaving the community to somewhat badly fill in the gaps.
I've used both Angular (mainly 1.x) and React, and they both have their place. I like React for its minimalism, but Angular for its modularity and formality. The latter fits well in a Java / OOP organization.
I've used both and I could completely replace Angular with React and some scaffolding code.
I used Angular on medium to large web apps in the past and while its easy to get started you always get tons of problems at scale. Staying at scale without problems requires so much discipline its not even worth mentioning.
The two-way bindings are just the wrong way to go in order to keep things simple as you scale. It becomes nearly impossible to reason about the performance of your app or what is going to trigger if you change a model.
This is way, way too complex to build an application. With React most of this complexity goes away. I'm also using React from ClojureScript through the Om library so these might be contributing to said simplicity!
I'm a mostly-backend dev that's been pressed into service on the frontend recently and I've worked on React and on Angular.
In my experience, I like the React way of defining components and functionality a lot better. The errors that Angular spits out from the HTML-templates are difficult to parse. There's also an unfortunate combination of a fractured community and incomplete first party documentation that makes Angular hard to ramp up on.
That said, Angular has a huge advantage that has made developing in it a lot faster for me. It's got everything right there. Angular doesn't have unique functionality, but it starts you off with a standard set of design patterns that stand you in good stead. React is just a frontend and when you're new to the space you don't know what else you need. Frequently, the productivity gain of not having to think about how to solve a problem is greater than solving the problem the "right" way.
Realistically, most teams solve this problem by having a senior team member who can pick technologies and design patterns. I haven't had that luxury on this last project, so I appreciate the Angular ecosystem. Javascript is great, but it's still very wild-west like.
Bi-directional data binding and the isolation between style, structure, and logic felt was less productive. Angular has some nice properties, like dependency injection built in, but you can circumvent many of those needs with a functional component tree in react (or limit the surface area across components). The simple fact that you need @Output event emitters to handle callbacks is a good example of how bloated it feels.
It may be that I don't know nearly enough about Angular but even after a year of doing my best to learn the idiomatic Angular ways I wasn't impressed.
reply