All Questions
117 questions
2
votes
1
answer
83
views
Alternative to ngrx store subscription in the component?
in an application I am working on, I am creating a component that blocks the screen (overrides whatever screen there is) when a certain condition occurs.
I am using NgRx for state management.
private ...
0
votes
2
answers
55
views
When is it necessary to unsubscribe in Angular?
I've gone through articles and videos and I understand how to unsubscribe, but I'm still having trouble understanding when I need to unsubscribe. Here is some simplified code I have in my project. I ...
1
vote
1
answer
107
views
Angular subscription either doesn't update the value or doesn't recognize value change
I'm fairly new to angular and currently building a web application using it. My issue lies in updating a value in one component after it's been changed in a different component with both components ...
0
votes
2
answers
74
views
Problems with the of operator of rxjs
I have a complex scenario where I need several observable to get some data.
I have a method like the following:
private collectData(): Observable<any> {
const defaultValues = {
prop3:...
1
vote
2
answers
158
views
Angular - unable to unsubscribe from valueChanges with Material Datepicker
I've had an ongoing problem with the emitting of a date in Angular Material Datepicker. I am working with an application where we have JSON files in Contentstack. The JSON files have the controls for ...
2
votes
1
answer
50
views
Angular homepage not loading on app launch when using observable - refresh and all is well
I have an Angular application which has an overview page as it's home page. The overview data is fed from a SignalR feed which updates every second.
I moved the feed into a separate service which ...
0
votes
1
answer
905
views
I'm getting the data multiple times , when I'm subscribing behavior subject from service in angular 14
I have a behavior subject in main component when the user click on update button it will emit true/false based on the condition.
That behavior subject is subscribed in another component and based on ...
3
votes
3
answers
3k
views
Complete BehaviorSubject
I’m using BehaviorSubject and subscribe to it using async pipe, do I need to complete the BehaviorSubject on component destroy?
*I don’t subscribe to it on the .ts file
0
votes
2
answers
727
views
Angular - avoid nested subscriptions by chaining multiple Observables
I'm trying to refactor my code, since it currently uses several nested subscriptions. I have a basic understanding of RxJS and was already able to rewrite some parts, but now I got stuck and ...
0
votes
1
answer
264
views
Angular observable receives data only once onInit
I am working my way through Moshs' Angular class building a simple shopping page. Since this tutorial is already quite old I had to work my way through the changes in bootstrap and angular and I did ...
2
votes
2
answers
407
views
Angular: promise error without a promise being used in a subscription
I have a material design table and I wrote custom functions to load the data and extract the objects from the JSON array object.
I have the following code:
public getDocumentList() {
return this....
1
vote
1
answer
983
views
Is it possible to return the value from subscribe? [duplicate]
this is my translate function, i require to return the array. Is it possible to return from Subscribe - ?
translator(items) {
const output = items?.map((item) => {
return this....
0
votes
0
answers
52
views
Angular - *ngIf on my buttons doesn't work on boolean changing value dynamically [duplicate]
I'll try to make it short. I assign a value (true or false) to a boolean depending of the size of my component.
html (I have two buttons with *ngIf) :
<section #carouselElement>
<button *...
0
votes
1
answer
183
views
rxjs subscription issue while updating the component UI
I am currently working on understanding the rxjs Observable, Observer and Subscription.
To understand the same I wrote a sample code for updating UI with the random numbers with the interval of 1 ...
0
votes
1
answer
228
views
How to avoid memory leak from Observable subscriprions wihtin a Service in Angular?
I am used to unsubscribing from Ovservable subscriptions on the ngOnDestroy Hook when I subscribe to an observable within a component. But the problem is when I subscribe from within a Service where ...