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
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
2 answers
171 views

Async pipe not updating view although subscribing and using the latest value of the attribute works in Angular

Consider the below snapshot that does't work: Parent.ts allowed$ : Observable<boolean>; Parent.html <child [allowed]="allowed$ | async"> Child.ts @Input() allowed : boolean ...
Ink Oveflow's user avatar
1 vote
2 answers
3k views

Benefits of using toSignal instead of async pipe

For example, I need to fetch some data via http request and assign the received value somewhere in template. I would like to know which of the following solutions is better and whether there are ...
Dima Savenkov's user avatar
0 votes
1 answer
213 views

async pipe .find now allowed in Angular template?

Can anyone help me understand why this is not allowed in the Angular template? <ng-container *ngIf="pt$ | async as pt"> <componenetOne[color]="pt.products.find(...
STH's user avatar
  • 123
2 votes
1 answer
2k views

Can't set signal from within async piped Observable

When I try setting a signal value from within an Observable that gets piped to async, I get the error: Error: NG0600: Writing to signals is not allowed in a computed or an effect by default. Use ...
Trevortni's user avatar
  • 748
0 votes
1 answer
549 views

How to update existing Observable in async pipe

I have an Observable that is subscribed to via the async-pipe. <ng-container *ngIf="invitations$ | async as invitations"> This Observable is set in the ngOnInit: this.invitations$ = ...
Century's user avatar
  • 303
0 votes
2 answers
857 views

How to avoid multiple observable requests to the backend when using async pipe in template

I am trying to return individual Arrays to each entry in mat-option-select conditional to some conditions. However when i use getFoos(rowIndex, matSelectIndex) | async. It cause multi request to the ...
Ahmed Aljazara's user avatar
1 vote
3 answers
3k views

Angular Keyvalue pipe for nested object

I have http request that returns an observable object of objects. it contains many properities. one of them is 'weight' object that contains two keyvalues, imperial and metric. I am trying to loop ...
Mamdouh Morad's user avatar
3 votes
1 answer
2k views

Proper Way for Handling Observables for Async Pipe Rendering

I am trying to retrieve information from an Observable Object. but I can't figure out how to do it properly. such as this for example, Dog API it should return a JSON object { "message": ...
Mamdouh Morad's user avatar
0 votes
1 answer
861 views

Angular Async Pipe - Array in Object in Observable

I am trying to Learn Async Pipe and how to use them. however I have an issue with using Async Pipe in the following case; I am using this fake/dummy API Cat API I can't figure how to retrieve the ...
Mamdouh Morad's user avatar
1 vote
1 answer
1k views

Get error: Type 'string[] | null' is not assignable to type 'string[]' while using an Observable and async pipe

I can see there are many posts on similar, but not quite the same as my VERY simple situation. I have a custom component (not mine) that has a string[] input. Now, when using this, if I have the ...
peterc's user avatar
  • 7,883
0 votes
1 answer
825 views

Async Pipe Shows loading template even after the Eventsource closed

I'm trying to fix a problem with the Angular async pipe and event source from a Spring boot WebFlux. I want to show the "loading data" message till the API call is done. Once the API returns ...
Ram Kurup's user avatar
0 votes
1 answer
975 views

Angular: Using data from async pipe in component class

I have some concerns on which is the best method for passing my observed data from the template into an external Modal. The data will be shown in the template with the help of the async pipe. The ...
user2622344's user avatar
  • 1,106
5 votes
2 answers
9k views

Async pipe not updating the view

Repro https://stackblitz.com/edit/angular-rlqkyb app.service Simple service creating a BehaviorSubject with some default values, a function to return this subject as an observable and finally a ...
ssougnez's user avatar
  • 5,906

15 30 50 per page