While going through the documentation for NgBootstraps Table component, I noticed that they use getters and setters to access their Subjects from a service.
See example here:
https://ng-bootstrap.github.io/stackblitzes/table/complete/stackblitz.html
in the country.service.ts
I have always just directly subscribed to services from my other components. ie rather than using a
get countries$() { return this._countries$.asObservable(); }
I'd just read this._countryService._countries$
, and subscribe to it or use async pipe as needed.
Is it a better practise to use getters and setters like this?