'What is the reason for $ in Angular [duplicate]
What is the reason for the $ used in Angular. Is it a specific RxJS
What is the reason for the $ used in the click$ & interval$ in the example code below:
const click$ = fromEvent(document, 'click').pipe(
map((e: MouseEvent) => ({
x: e.clientX,
y: e.clientY,
id: Math.random()
})),
tap(addHtmlElement),
mergeMap(coords => subject.pipe(tap(v => setElementText(coords.id, v))))
);
const interval$ = interval(1000).pipe(
tap(v => subject.next(v)),
tap(v => setElementText('intervalValue', v))
);
merge(click$, interval$).subscribe();
Solution 1:[1]
The $ suffix is only a naming convention used for observables. It has no deeper meaning - analogous to naming interfaces with an I prefix (e.g. ICollection).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | pascalpuetz |
