Skip to main content

All Questions

Tagged with
1 vote
1 answer
52 views

Initial value not displayed on mat-select component using async pipe

I'm trying to use a material select component that gets its values through an Observable with async pipe. template: <mat-form-field> <mat-select value="selectedOption$ | async&...
Watttttt's user avatar
1 vote
1 answer
50 views

How to refresh and listen to the refreshed data inside one stream

The important part of my code looks somewhat like this: data$:Observable = this.dataRefresh$.pipe(switchMap(() => this.http.get('url')), shareReplay()); dataRefresh$:Subject = new Subject(); ...
Mirz's user avatar
  • 33
0 votes
1 answer
55 views

foo.subscribe with bar not always working

Imagine we have foo$ and bar$ and both of them are BehaviorSubjects. I have a bug in angular that sometimes in some cases foo$.subscribe(bar$) works fine, in most casses actually. But sometimes I have ...
Muhamed Karajic's user avatar
1 vote
1 answer
34 views

Angular Query Tanstack Query cleanup logic

I'm using Angular 18 with TanStack Angular Query and have a question about handling observables in the queryFn. In my queryFn, I'm using lastValueFrom() with an HTTP request like this: queryFn: () =&...
Eternal Sunshine's user avatar
1 vote
1 answer
21 views

Compare emitted values from the same Request

In my angular component I fetch a list of objects via http-Request and render that data in a List and set some additional configdata based on that list. In the end I have a "proceed" button ...
Sergej Bjakow's user avatar
2 votes
1 answer
207 views

Not able to make firstValueFrom/async work with Angular

I'm trying to create an Angular (v19) app, which basically consumes an API and uses the responses to render the app's UIs. A pretty standard scenario. The only thing more “audacious” is that I would ...
Bob Rivers's user avatar
  • 5,489
0 votes
1 answer
49 views

How to pass an array of pipable operators to pipe()?

[Angular 12]I have a service with a method, handleFormControlChanges, which accepts, a formControl, a destroy subject, a method and an array of pipable operators (e.g., delay), and I would like to ...
Yegor Petrov's user avatar
1 vote
1 answer
66 views

Input Subject is empty in child component Angular 17

I am trying to pass data from a parent to its child component in Angular 17. The data is retrieved from the back-end through an API that gets an array of items. In my parent component, items$ is a ...
Ems's user avatar
  • 182
0 votes
0 answers
54 views

Angular Tanstack Cached Observables are refreshing data and not using the cache causing problems

I'll keep it short as possible >< -I have a left hand menu with items that can be expanded/collapsed. This is dependent on "getAll()" and works as expected. -When I incorporated "...
NeuralCode's user avatar
1 vote
1 answer
135 views

Why using EventEmitter in angular is considered bad practice

In an angular project (v17), I've used EventEmitter to notify one component, of the changes of another, somewhat unrelated (not a parent nor grandparent, not a child nor a grandchild) component. I can'...
III_phr's user avatar
  • 96
1 vote
1 answer
91 views

Call function after signal value change

I have a component with a simple login form. @Component({ selector: 'app-login', standalone: true, imports: [ ReactiveFormsModule, MatCardModule, ... ], templateUrl: './login....
Pawel's user avatar
  • 11
1 vote
3 answers
66 views

Initialize BehaviorSubject with value from Observable

I was trying to create an item counter for Wishlist Entries in my header area and tried to apply the solutions suggested here (for Cart Items) Change shopping-cart count in header in Angular ...
Sergej Bjakow's user avatar
0 votes
2 answers
94 views

Losing reference to this in async function inside subscribe [closed]

I'm almost new to Angular and I'm really lost with the async and sync methods, await, observables, promises... I have a button that opens a modal window, reads a barcode and with the information of ...
Nessarose's user avatar
2 votes
3 answers
138 views

How to modify data in an angular component when using async pipe

I have an Angular 18 component that receives an observable, which I render on the page using an async pipe. I want to be able to modify the data within this component and then press a "Save"...
Chris Barr's user avatar
  • 34.3k
1 vote
0 answers
48 views

RxJs Observables and Subjects resolving async process times when browser is in focus

I'm a bit new to Angular and have forked a complex project that in a subscription to a websocket, uses Observables, Subjects and ReplaySubjects altogether to achieve a function that I summarize here: ...
Manu Sisko's user avatar

15 30 50 per page
1
2 3 4 5
406