Duration: 14:02 min
Summary: In this lesson, we will see how to create a service using the service and the provider approaches. As I stated earlier, services are pieces of code that can be used across the application. They are reusable components within the same application. There are three ways to create services: (1) Factory (2) Service (3) Provider. I have already discussed the factory approach in the previous video. Today, I will show you how to create a service using the service approach and the provider approach. As you will see, creating these services is very similar. Choose one that you are comfortable with and use it. If you dig deeper into Angular, you will see that there are some advantages of using one type versus the other. But for now, you can see that creating these types of services is very similar.