Guards and resolvers can now be plain functions in Angular v14.2.0. The inject()
function can be used inside the function if we also want to use DI. For example:
You can read this article to find out how it works.
Now that we can use plain JS functions, we…