Subscribing to Observables

Learn how to subscribe to observables to be notified of events.

We learned that an observer needs to subscribe to an observable in order to start getting emitted data. Our products and product-view services currently emit product data using observables. We must modify their respective components to subscribe and get this data:

  1. Open the product-list.component.ts file and create a getProducts method in the ProductListComponent class:

Get hands-on with 1200+ tech skills courses.