Other Services
Find out what logic is implemented in the remaining services for the Movies application.
We'll cover the following
Listening for changes to movies data
We will perform movie searches within our application, retrieve saved searches, and potentially remove movies from the display.
As a result of these different tasks, we will need a way to ensure that data is consistently shared between different application screens and within the same screen where required.
To do this, we’ll make use of the RxJS library’s BehaviorSubject
utility, which allows cross-component communication to be easily facilitated.
Let’s wire up our BehaviorSubject
(which we will subsequently subscribe to within our page components and custom components) using the MoviesListenerService
located at src/app/services/movies-listener.service.ts
(amendments highlighted):
Get hands-on with 1200+ tech skills courses.