Making a GET request
Applications often request JSON data from the server. For example, the app might need a configuration file on the server.
The ConfigService
fetches this file with a get()
method.
config.service.ts
A component, such as ConfigComponent
,and calls the getConfig
service method.
Config.tsx
Because the service method returns an Observable
of configuration data, the component subscribes to the method's return value.
Last updated