Subject and Behavior Subject in Angular 12 - Example.
Subject:
Subject is a special type of Observable in RxJs Library in which we can send our data to other components or services. A Subject is like an Observable but can multicast to many observers which means subject is at the same time an Observable and an Observer.
Behavior Subject:
Behavior Subject is similar to subject but only difference is that we can set the initial value.
#subject #behaviorSubject #observable #rxjs #angular #frontend #web #development