Alain Chautard
1 min readNov 8, 2019

--

Both options work the same way. It is usually advisable to return a subject “as an observable” though so that the client-code can’t use the subject to emit data.

As a result, I would recommend to always use asObservable()

--

--

Alain Chautard
Alain Chautard

Written by Alain Chautard

Google Developer Expert in Angular, Consultant and Trainer at http://www.angulartraining.com

No responses yet