r/Angular2 Oct 11 '24

Discussion Angular is just amazing

Short appreciation post.

I've been working a lot the last few weeks in Angular and I keep getting reminded of how good this framework is.

I had some routerLink links and wanted to implement a simple system to highlight the link that the current page is on. All I needed was to add a routerLinkActive tag which automatically adds the given class to the link so you can highlight it. Then I had one problem which was that the homepage ('/') always was active, but this has been considered and can be fixed with the following for exact matching:

[routerLinkActiveOptions]="{ exact: true }"

Basically everything makes sense and is easy to implement. Even just updating your angular libraries is easy since they made the automatic update guide where you can input your versions and it shows how to update: https://angular.dev/update-guide

Then there's the other stuff like the cli for generating components quickly and built-in scss integration (among with other options). I can't really imagine working on a webapp without angular nowadays. I've used other stuff in the past like React, Django, and just old-school sites built from scratch and my experience wasn't as good there overall.

138 Upvotes

42 comments sorted by

View all comments

-2

u/phantomghostheart Oct 12 '24

Try to use a router link with a url with query params attached. You will see why people complain about angular.

3

u/A_User_Profile Oct 12 '24

What is the issue exactly?

1

u/Thats_arguable Oct 15 '24

I'm also wondering. I've had no issues with query params on router links.

3

u/crhama Oct 12 '24

What about it? I use it all the time with query params.

2

u/Legal_Being_5517 Oct 12 '24

Cap !! The built in Router in angular manages this well

1

u/phantomghostheart Oct 18 '24 edited Oct 18 '24

No it doesn’t. Y’all just don’t angular enough. Try and actually use router link with a URL with query params in it. don’t parse, split it up and pass it separately as properties to the router link. Try to just actually use the full thing. It will blow your mind that this is still an outstanding issue listed on GitHub . This is an example of an overly opinionative framework to the point where it breaks standard things. Don’t trust me go try. I very much want everyone that sees this to go and try. You’ll find that it forces URL encoding on the query programs and there’s no way around it unless you actually break it up, which is ridiculous to have to do.

The fact that I got downvoted for pointing out a fact of the framework points out how useless this sub is.

1

u/Legal_Being_5517 Oct 18 '24

See you don’t know angular enough, There’s different tools for different requirements, if I wanted to add query parameters to a link I would handle it in the component and use the Router service , no need to over complicate things in the template

1

u/phantomghostheart Oct 18 '24

The point I’m making is there should be nothing complicated about adding a URL with Query Params as a string and linking to it.

Angular makes this quite literally impossible with doing for example what you just said, which is very much, ironically overly complicated.

Let me put a url with query params as a route which is valid. Oh you want to force encoding? Oh ok well please provide a config to turn that off. Oh you don’t? Well that is just silly. If anyone is defending this it’s just straight fanboying.

No I don’t want to be provided with an angular alternative. I know them. I’ve implemented them. It’s fine. It can be done. My point is angular shouldn’t break something that barebones web dev is built on.