Note: This course is still valid for Angular ^17 but the set up has changed.
Services and registering service providers are an inherent part of an Angular application. It is where you should define your application logic, they keep the state of the application and allow to share that among different components.
That said, components can ask for instances of services by specifying them as parameters of their constructor functions which will then provided at runtime by Angular’s dependency injection mechanism. While services themselves are mostly just plain ES2015 classes, there are some interesting things to discover, especially when it comes to dependency injection.
We can define services at various levels within our application, which allows us to control the scope and visibility of a given service. We can furthermore alias old service definitions to new, existing services which is handy for refactoring scenarios and we also have the possibility to define so-called factory functions for fully taking control of how a given service is being constructed.
In this course we will take a closer look and walk step by step through all of these scenarios.
its good and all the concepts are clear.
in depth explanation of angular services, really appreciate your work towards the community.Thank you
Because there is only how to use something and not why and what is best use-case.
This course goes soooo much into deep concepts! I did not expect such a fine grained details in the course. Specially the lesson when he demonstrated the useExisting property, I was like "hey we can use useClass can't we? He told it's the same usage." And Juri started saying "you might be wondering why we didn't use useClass?" That is getting into the head of the student which every instructor should be able to.
This may be out of scope for this course, but some real-world use cases for @Optional
, @SkipSelf
and @Host
would be useful. I can't think of any that make sense.
To me @Host
is redundant. If you have your dependency in the providers array of the component, it's essentially retrieving the dependency from the host. Adding the host @Host
decorator on top of this won't do anything. Is it only useful as a sanity check to ensure the dependency is provided in the component?
I also have trouble with the use case for @Optional
. On the face of it it seems like a way to workaround an injection error - I've always viewed DI as a contract or guarantee that these dependencies will be available.
The way of Juri's explaining is great. Telling the scenario and we can overcome that scenario is a great way helps in apply the learned material into our realtime projects at works Thank you very much for your effort Juri
Become familiar with the Workers CLI wrangler
that we will use to bootstrap our Worker project. From there you'll understand how a Worker receives and returns requests/Responses. We will also build this serverless function locally for development and deploy it to a custom domain.
This is a practical project based look at building a working e-commerce store using modern tools and APIs. Excellent for a weekend side-project for your developer project portfolio
git is a critical component in the modern web developers tool box. This course is a solid introduction and goes beyond the basics with some more advanced git commands you are sure to find useful.