
Angular Cookbook
By :

Streams are fun to work with and they're awesome, and you'll know much more about RxJS when you've finished this chapter, although problems occur when streams are used without caution. One of the biggest mistakes to do with streams is to not unsubscribe them when we no longer need them, and in this recipe, you'll learn how to unsubscribe streams to avoid memory leaks in your Angular apps.
The project for this recipe resides in chapter05/start_here/rxjs-unsubscribing-streams
.
npm install
to install the dependencies of the project. ng serve -o
. This should open the app in a new browser tab, and you should see something like this:
Figure 5.8 – The rxjs-unsubscribing-streams app running on http://localhost:4200
Now that we have the app running locally, let's see the steps of...