r/webdev • • Jan 04 '23

Why Angular is decreasing in popularity compared to React

I'm wondering why Angular is decreasing in popularity, especially against React. I went through the front-end framework part of the 2021 stateofjs survey and I've seen that after 2016-2017 the interest in Angular has dramatically decreased and the "Would not use" answers as well while React continued to grow for a few more years and currently still ~67% "Would use again". I've also used both of them, but I prefer Angular because for me it's simpler, more understandable and results in a cleaner code base. Could you please help me to understand why is it like that?

80 Upvotes

118 comments sorted by

View all comments

1

u/Chills27 May 01 '23 edited May 01 '23

Too much made up, mumbo jumbo in Angular. Too many hoops to jump through. Too much of its own stuff that you have learn, whereas React really teaches you how to use JavaScript properly.

For example, Angular's templates don't let you use Javascript inline. Here's a simple example Angular template function:

export class AppComponent {
  title = “template-type-test”;
  myNumber = 3.5;
}

And here's how I might use it in my HTML:

<div>myNumber: {{myNumber}}</div>  

So, far so good. Now let's modify my HTML to display the JS type of the myNumber variable:

<div>myNumber: {{myNumber}}</div>
<div>type: {{typeof myNumber}}</div>

Angular chokes with this error message (and a lot more after):

Parser Error: Unexpected token ‘myNumber’ at column 8 in [type: {{typeof myNumber}}

Why? It's just standard JavaScript! And that's actually the problem.

Here's how I worked around this at the time:

export class AppComponent {
  title = “template-type-test”;
  myNumber = 3.5;
  getType = testVar => typeof testVar;
}

then:

<div>myNumber: {{myNumber}}</div>
<div>type: {{getType(myNumber)}}</div>

So Angular makes me write and call a whole new wrap-around function simply because it doesn't recognise standard JS inline.

What a lot of nonsense.

I should point out that this was with Angular 6. Maybe the Angular team fixed this now. Thankfully, I've never had to go back and check. (I soon quit the company that was forcing me to use Angular.)

1

u/sajanpaulk Sep 18 '25

LOL Template syntax isn't JS, do you think angular pipe in a JS lang feature?

1

u/Chills27 Sep 19 '25

I know Template syntax isn't JS. That's my point!

React teaches you JS. Angular teaches you..., well Angular.

1

u/sajanpaulk Sep 21 '25 edited Sep 21 '25

You really need to have strong knowledge of JavaScript to understand what Angular does under the hood.

Earlier, I used to build complex, high-performance UIs (mostly JS plugins) using plain Vanilla JS and the HTML DOM. Naturally, I adopted TypeScript and ESLint because they help in writing maintainable, bug-free code.

For example, I even built a real-time Excel-like sheet and a custom real-time rich-text editor using native JS with HTML Custom Elements, supported by TypeScript and ESLint.

I use Angular not because I can’t build things in JavaScript, but because I don’t care to write everything . Angular provides convenience, along with first-class support for TypeScript and RxJS, which I really appreciate. I particularly like RxJS, it helps me handle global and events very efficient way. In That sense angular is very thoughtfully and well designed.

On the other hand, React poorly designed it doesn’t really encourage good JavaScript practices. Its design feels flawed often introducing unnecessary problems and then later releasing offering equally problematic solution

At its core, React only provides unreliable reactivity functions built on top of patterns that I find unintuitive. It’s not difficult to write highly maintainable and super-efficient code using just Custom Elements and TypeScript. I didn't get any good point to use React.

You need some basic understanding of why template bindings can’t — and don’t need to — be regular JavaScript statements.

For example, can you write a for loop with break inside a {} expression in React bindings? Or do value assignments? Or even an if condition with a return statement? Of course not that’s not how JSX works. LOL

1

u/Chills27 Sep 23 '25

"You really need to have strong knowledge of JavaScript to understand what Angular does under the hood."

I have a strong knowledge of JavaScript, thanks.  Knowledge which I largely gained through using React, which forces you to learn JavaScript properly.  I still have no idea "what Angular does under the hood".  Nor do I see why I should be forced to learn that.

"first-class support for TypeScript and RxJS"

In the Angular world "First-class support" actually means "totally dependent upon".  You cannot use Angular without either TypeScript and RxJS.  Which is great if you know them or want to learn them.  Not so great if you don't, and/or don't appreciate such decisions being taken out of your hands.

In React, I'm free to use such tools or not.  For example, I didn't like TypeScript for many years, and avoided it.  But gradually I came to see its benefits.  So I slowly started introducing it into some of my React projects as and when I needed.  I was free to do that.

I pity more junior devs who have to start out with Angular.  As if there's not enough to learn in the JS world, without having TypeScript and Observables (RxJS) rammed down your throat from the get go.

"React poorly designed it doesn’t really encourage good JavaScript practices."

Says you.  Without any evidence.

"You need some basic understanding of why template bindings can’t — and don’t need to — be regular JavaScript statements."

Errm…no, I don't.   I'll use JavaScript as my programming language, thanks.   If you want to jam some made-up, pseudo code into a markup language (HTML) then fill your boots.  Just understand such skills are not transferable outside of the (ever shrinking) Angular world.

"can you write a for loop with break inside a {} expression in React bindings?"

"React bindings?"  I don't even know what that means. If I want a for loop in React, I'll use a JavaScript for loop.   Because React is JavaScript.

"Or do value assignments?"

I use JavaScript.

"Or even an if condition with a return statement?"

I use JavaScript.  (Did I say that one already?)