logo
logo
AI Products 

Angular Service Go get JSON

avatar
Tech Mekrz
Angular Service Go get JSON

In this exercise we will demystify the Angular Service by taking a simple pragmatic approach to implementing a service that retrieves a JSON file from the server using the HttpClientModule.

The notion of Services is that of a “Design Pattern”.

At the end of the day a Service is nothing more than a class.

What makes it fancy is combining it with Dependency Injection (DI) which handles instantiation & construction for us.

Meaning that they will only be instantiated once within the current context.

By injecting a Service in multiple locations such as a parent & child component you can effectively share the state of objects.

collect
0
avatar
Tech Mekrz
guide
Zupyak is the world’s largest content marketing community, with over 400 000 members and 3 million articles. Explore and get your content discovered.
Read more