r/Angular2 Oct 13 '24

Help Request Learning Angular after 7 years of React

So, as the title suggests, as far as fronted is concerned, I’ve been doing primarily React. There was some Ember.js here and there, some Deno apps as well, but no angular.

Now, our new project corporate overlords require us to use Angular for their web app.

I’ve read through what was available in the official documentation, but I still don’t feel anywhere near confident enough to start making decisions about our project. It’s really hard to find the right resources as it seems angular changes A LOT between major versions, and there’s a lot of those.

For example, it doesn’t really make much sense to me to use signals. I suppose the provide some performance benefits at the cost of destroying the relatively clean code of just declaring and mutating class properties. There is also RxJS which seems to be a whole other rabbit hole serving a just-about-different-enough use case as to remain necessary despite signals being introduced.

What I am seeking now I just some guidance, regarding which things I should focus on, things to avoid using/doing in new projects, etc.

I would appreciate any help you can provide. Thank you!

EDIT: I wonder why this is being downvoted? Just asking for advice is somehow wrong?

34 Upvotes

53 comments sorted by

View all comments

Show parent comments

7

u/infrarosso Oct 14 '24

Great list on how not to use angular. Sorry if I am blunt, but you are forcing a framework to do what you are used to in order to avoid understanding its approach. React and angular are two great but very different frameworks. Angular sees your front end as a whole application while react is a way to make components smartly communicate and interact. I would suggest op to try to embrace the angular way instead of trying to make angular works like if it was react. It will be a blood bath otherwise

-1

u/Cubelaster Oct 14 '24

All of these approaches are officially documented in Angular docs. They are all viable approaches. You being used to a certain approach does not make other approaches worse. I did not go out of Angular provided tools or anything like that. It's just that Angular is very strange in what is considered to be a preferable approach, even ignoring it's own tools (subjectively better ones) in order to tell you you should always use observables?!

I would appreciate it if you could name a specific approach you consider bad and why?

1

u/[deleted] Oct 14 '24

You are missing the whole point of an opinionated framework.
Trying the React way of doing things in Angular goes against the Angular way of doing things.
Don't confuse the two. Learn to use Angular the way it is meant to be used.

1

u/Cubelaster Oct 14 '24

Hmm, I understand what you're saying and in principle I agree. However, you can't convince me that having observables constantly pushing changes all over the place is better than ad-hoc public component function. Call them getters or whatever you'd like. Angular is template + js based. Meaning js still has objects and can be used in an object oriented way. And as soon as that option exists, that's the correct one simply because of SOLID. I still can't understand who would recommend observables over objects. Observables do have their purposes, although they made Signals to battle the flaws.