this post was submitted on 17 Jun 2023
0 points (50.0% liked)

WebDev

1150 readers
1 users here now

Community for all things Web Development related.

founded 1 year ago
MODERATORS
 

Hello,

In Angular 15, there was a deprecation of class-based Guards and Resolvers, which has sparked discussions regarding this decision. The deprecation of these interfaces is seen as a regression that goes against established software engineering practices. Some argue that there wasn't sufficient discussion on the topic.

Deprecated: Class-based Route guards are deprecated in favor of functional guards. An injectable class can be used as a functional guard using the inject function: canActivate: [() => inject(myGuard).canActivate()]

Deprecated: Class-based Route resolvers are deprecated in favor of functional resolvers. An injectable class can be used as a functional guard using the inject function: resolve: {'user': () => inject(UserResolver).resolve()}.

This move doesn't seem right and I started an issue here https://github.com/angular/angular/issues/50234 and there's also discussion about this here https://github.com/angular/angular/pull/47924.

To raise awareness and gather feedback from the community, I ask everyone to engage on the discussion.

Thank you.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here