21,342 questions
0
votes
0
answers
27
views
Angular 21 Vitest, FakeTimers and RxJS debounceTime
I could successfully migrate my Angular 20/Jasmine/Karma app to Angula r21/Vitest
All my tests are running correctly, except the ones that use debounceTime from RxJS
As a workaround for now, ny unit ...
1
vote
0
answers
37
views
Angular table fails to update after CRUD success
My app uses a facade service (singleton injectable) with signals for state management and RxJS for API calls.
I'm experiencing an inconsistent UI update problem with a table after a successful create ...
1
vote
1
answer
53
views
How to prevent RxJS to stop pipeline execution on the first exception
I'm trying to make 3 sequential GET requests using RxJS ajax operator. If one of the ajax requests throws an error(404 status code, for example), the rest won't execute. Is it possible pipeline to ...
0
votes
1
answer
73
views
Strange behavior in compiled Angular 18 application TypeError: this._serviceXXXXXXXX is not a function
We are facing strange error in our application, some users facing problems with export functionality. Code below is what we have in our codebase:
exportProcess = this.exportProcessSubject.pipe(
...
3
votes
1
answer
32
views
RxJS switchmap-like operator that gives me the result of the first observable too
Suppose I want to do the following
this.http.get(...).pipe(
switchMap(httpResult => this.database.storeValue(httpResult.objectA)
).subscribe((databaseResult) => {
// I have lost the ...
0
votes
1
answer
101
views
After DELETE callback works in same file but not in a service
I am making an Angular frontend and got really unexpected behaviour after an HTTP DELETE call.
When in component code I call directly HttpClient.delete, it logs 'test'.
If I call the delete in a ...
4
votes
1
answer
75
views
Should we use NgZone.runOutsideAngular() when handling fromEvent with filters in Angular
I came across this implementation of the outsideCLick directive
ngOnInit() {
this._ngZone.runOutsideAngular(() => {
fromEvent<MouseEvent>(document, DomEventsEnum.MOUSEDOWN, { ...
1
vote
1
answer
148
views
Angular API data not loading on page refresh unless user triggers interaction
I have an Angular 20+ application with a route /explore-developers that should load a list of developers from my backend API when the page is opened.
I have an Angular 16 application with a route /...
1
vote
1
answer
114
views
Test coverage not detected with toSignal and debounceTime
I have a component in my Angular project (v18.2.13) that has a reactive form to change a price field & an observable with the product info. I want to make a signal to know if the price form field ...
1
vote
1
answer
199
views
Multiple resource API calls in Angular
I am trying to understand the new Angular resource API. One typical problem is to fetch several HTTP endpoints, combine the data and use it.
My current approach looks like this:
name = rxResource({ ...
2
votes
1
answer
284
views
Angular 20 claims async pipe result to be unknown despite it being properly typed [closed]
I recently tried upgrading my project from Angular 19 to Angular 20. Now Angular throws the following error for all my async pipes:
Type 'unknown' must have a '[Symbol.iterator]()' method that returns ...
2
votes
4
answers
94
views
How to remove following RxJS antipattern?
I have some common code which needs to be executed as a callback in either of (if/else) aysnc function call. Following is the hypothetical snippet of my code.
if(condition1) {
asyncFun1()....
0
votes
1
answer
41
views
Making flowing text with RxJS - pass string to another observable
I created a function which makes some text flowing:
private createFlowingText(message: string): Observable<string> {
const intrvl = interval(180);
const text = from(message);
...
2
votes
1
answer
41
views
How is 'next' functioning when called on a Subscription?
Due to a bug in my code, I accidentally called next on a RxJs subscription in a way that the compiler wasn't able to catch. In essence though, here's a MCVE:
import { Subject } from 'rxjs';
const sub ...
1
vote
1
answer
81
views
Angular displaying Observable Array
I have an API (Node.js) and an Angular frontend.
Now I want to loop through the data and display it. Therefore I perform an HTTP Request to the backend and get back an Observable which i then want to ...
1
vote
1
answer
142
views
Async pipe not updating HTML
This might be a common problem but somehow i keep hitting wall with it
HTML
@if(data$ | async; as data) {
<span>{{data.status}}</span>
}
TS
dataId = input.required<string>();
data$ =...
2
votes
2
answers
149
views
How to use an Angular Route Title Resolver to wait on an observable?
I have an Angular 19 app and I am trying to add a route title resolver that gets the page title by looking up some data in the results of an Observable.
The issue is that when the app first loads, the ...
1
vote
2
answers
67
views
Prevent last emission - causes duplicate message
I need the LAST emission to call signals.onResponse(), thus the tap, so that my deep chat ui completes and re-enables the submit button after last message. I have to hack deep chat and use the ...
1
vote
2
answers
70
views
Rethrowing Errors When Using forkJoin
I'm working on an Angular (v18) SPA app. I have an API service with a get call:
public get(route: string, params?: HttpParams): Observable<any> {
const headers = {
method: 'GET'
}...
2
votes
2
answers
76
views
I update a shown value from a subscription, why is my new value not shown? [duplicate]
I have an Angular component that shows a member variable of its TypeScript class. I subscribe to an rxjs Observable to update the value. I see that my rxjs Subscription is executed, but the new value ...
1
vote
2
answers
101
views
Manipulate Observable data prior to subscribe method call
I've been using Angular with RxJS for about a year and a half now. I feel pretty comfortable in most areas, but I'm struggling a bit with RxJS. Several times now I've found myself wanting to ...
2
votes
2
answers
57
views
Angular NGRX test a selection subscription with pipe skip
My method works the way I want it to, however, the test is failing when I add the pipe(skip(1))
How do I test an observable with a pipeable skip. Here is my method:
getSomething() {
this.store....
0
votes
1
answer
72
views
I am updating the angular component properties inside a if block and I feel it is not updating
ngOnInit() {
this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
if (event.url === '/common/time') {
this.zone.run(() => {
...
2
votes
1
answer
77
views
How do I return two http requests sequentially in rxjs and use data from first in second call?
I've written a http function that works using switch map to get the value from one http request and use it as a parameter in the second, but how do I return not only the final http request but also ...
0
votes
1
answer
184
views
How do I set an empty array as default value in toSignal?
I have a DataHandler service that calls a database service and returns the value to the calling component. The database service returns an observable of an array, while I'd like the data handler to ...