DEV Community

The Famous Misconceptions in Angular

Vugar on May 31, 2021

As Front End developer who worked in Forune 500 companies such as Raymond James financial advisory company and SwissRe leading insurance broker, ...
Collapse
 
dylanesque profile image
Michael Caveney

So, I don't agree with the learning curve at all: If you don't know RxJS or TypeScript beforehand, the time to get up to speed with those (especially RxJS) will significantly make it harder to learn Angular. Another thing that makes is a lot more difficult to learn is that there are multiple ways to do things (for example, pass data between components) without clear weigh-in on when you should favor, say, services versus Input/Output decoprators.

Collapse
 
vugar005 profile image
Vugar • Edited

Hi. Thanks for comment. This is one of the things I pointed there, even though projects not using Angular, they are using Typescript and it getting more popular. Even Vuejs switched to full Typescript. Many folks who were critizing Angular for using Typescript, they are now happily using Typescript with React or Vuejs. Regarding, RxJs yes, it has learning curve. But what is alternative of that? Promises, thunk, Redux saga? Unfortunately all comes with cost. RxJs takes time to learn and master but as a result the code is neat, easy to read and flexible which is crucial in long term projects. Please see newly added screenshots on post. In addition, you are not obliged to use RxJs, you can convert it to Promise any time with from operator but I haven't seen anyone to prefer promises by giving up RxJs powerful opeators.

Collapse
 
dylanesque profile image
Michael Caveney

You can write async code just fine without a complicated library like Redux Saga or RxJS. RxJS really shines when you have to combine or pick through data in a certain way, but it's total overkill as the base data-fetching paradigm for Angular.

Thread Thread
 
vugar005 profile image
Vugar

Well in that case don't use RxJs in case of feeling overkill. It is totally fine, but you never know, requirements are rapidly changing so you end up refactoring to RxJs or other libraries.

Thread Thread
 
shaijut profile image
Shaiju T • Edited

In some Angular tutorials, RxJs is used to make simple http call to API. Is the purpose RxJs is just to make Ajax call or there any particular use case to switch to RxJs?

By the way, Below RxJs video made it simple to understand.

youtube.com/watch?v=eUYigtm3Sdc

Thread Thread
 
vugar005 profile image
Vugar

I just updated the blog, with and without RxJs example. Thanks.

Thread Thread
 
dylanesque profile image
Michael Caveney

You cant uncouple RxJs from the Angular HTTP API.

Thread Thread
 
dylanesque profile image
Michael Caveney

You cant uncouple RxJs from the Angular HTTP API.

Thread Thread
 
vugar005 profile image
Vugar • Edited

Hi Michael, you can convert Angular HTTP to Promise . See getData method in stackblitz.com/edit/rxjs-vs-promis...
Also developers are not obliged to use http, you can use fetch or some techiques. Http just adds additional useful features.

Thread Thread
 
lyrod profile image
Lyrod

It is really good to use angular http api (rxjs observable) when you want the ability to cancel any request by unsubscribing the subscription

Thread Thread
 
dylanesque profile image
Michael Caveney

The async pipe IS extremely nice

Thread Thread
 
lyrod profile image
Lyrod

Indeed

Collapse
 
polyterative profile image
Vladyslav Yakovenko • Edited

I am really pleased to meet an article that does angular it's justice.
I partially agree with the learning curve discourse but it must be specified that the technologies necessary to use angular's full potential completely change the workflow positively.
Since I learned RxJS I stopped imperative programming completely because ReactiveX is just that good.
Angular is just that productive if you're serious about strong and maintainable code.
I love it 3000

Collapse
 
thorstenhirsch profile image
Thorsten Hirsch

IMHO the greatest benefit of RxJS is that it changes your way to look at data. Without RxJS you've got a "procedural" mindset: first do this, then wait for data, then do that. It's like fetching water in buckets - one by one. But RxJS teaches you that data flows between your components and you literally build pipes, a network of pipes, so that the data automatically reaches all the components it should. It's powerful, elegant, and I'm pretty sure it even makes apps more robust. But boy does it have a steep learning curve compared to async/await!

Collapse
 
kotov profile image
Georgi Kotov • Edited

Nice article... hard to come by those which are not bashing Angular...
Honestly I've started with Angular 2 as my first SPA framework and not sorry about it.
My first project was an online exam platform, which was used by ~50k people.

I would say the advantage that Angular gives you even as a beginner is that it provides structure and implicitly makes you think about it . I've done little with React but my impression is if you haven't done any prior coding it's easy to get it to a spaghetti level.

While the above statement is true with any programming language I think Angular does a good job to provide you with code segregation principles and having the scaffolding more organized to services, components, modules spec etc.

RxJS is just great at any level with great docs and even for a beginner it's easy to comprehend how to use it and how combine/mutate with multiple sources, streams etc.

Collapse
 
kuncevic profile image
Aliaksei Kuncevič • Edited

There are a lot of misconceptions about Angular in non-angular communities because some referring to Angular when really still thinking Angularjs (v1.x.x). You can also checkout frontendwatch.com for more details about Angular and other top front-end frameworks.

Collapse
 
shaijut profile image
Shaiju T • Edited

Nice 😄, I think Angular is used to build enterprise level and large apps so its easy to maintain the code base.

There is a saying : "Use right tool for the Job".

Which means Angular and React are not the right tools for every Job. Sometimes the right tool for your project can be Angular, React, Java, Node.Js, .NET etc...

Before 10 years it was PHP , Now Angular, React etc , Who knows what will be in future ?

Hope you understand the point. 😄

PS: Some interesting posts:

dev.to/rohitrana/why-react-is-winn...

dev.to/ben/which-javascript-framew...

dev.to/cadienvan/the-best-way-to-l...

Collapse
 
teja463 profile image
Brahma Teja Ponnuru • Edited

Really great detailed explanation. Yes most of the enterprise applications prefer Angular. But IMO... In React it is very clear and straightforward to pass data and functions to child components, dynamically rendering child components, to find out why a component is re rendered, how the state has changed etc. But in Angular I don't think it is that easy. I feel it takes less time forba react developer to go from a beginner to pro, buy in angular it might take more time.

Collapse
 
shriji profile image
Shriji

If you want to add complexity to your stack and make heavy applications use Angular.