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:
Open the
product-list.component.ts
file and create agetProducts
method in theProductListComponent
class:
Get hands-on with 1400+ tech skills courses.