All Questions
14,091 questions
1
vote
1
answer
44
views
Angular toSignal's read-only result as a writable signal
In my Angular service, I currently have a signal variable loginById$$ initialized from an observable:
public loginById$$: Signal = toSignal(this.getLoginById(), { initialValue: {} as LoginResponse });
...
1
vote
1
answer
25
views
ERROR TypeError: Cannot read properties of undefined (reading 'companyForm')
I'm trying to fetch data like boolean isCompany and Strings companyName and nip from users table from backend and set it as default in fields in the form. All other data are patched correctly. There ...
1
vote
0
answers
12
views
Angular Jest mock post request
First time using jest and I'm having some big problems on mocking a service with a post method request. I think I spend more than 6 hours on this and still can't pass it.
I would appreaciate any help.
...
-3
votes
0
answers
26
views
How to preserve selection state? [closed]
There is a table and in the table there is checkbox. If I select any row and perform search, this search is being through api call so when new data come already selected row selection got removed. I ...
0
votes
0
answers
43
views
HTTP request not returning an observable? Browser throwing error: 'You provided an invalid object where a stream was expected'
I have some logic that requires 2 nested API calls - so I decided to use switchMap. But the app doesn't think the second API call is an observable. The project lives in a monorepo, but the weird thing ...
1
vote
1
answer
45
views
how to replace a service with a Subject with signals?
Say I have a very simple shared service holding a subject:
@Injectable({ providedIn: 'root' })
export class MyService {
private _runTaskSubject = new Subject<string>();
get ...
1
vote
1
answer
42
views
Unsubscribe before second subscription
How unsubscribe in rxjs before second subscription of Subject without takeUntil? I have DI service with a lot of chunks observables. For simplify I shorted it for one problem.
const test$ = new ...
0
votes
0
answers
33
views
API request fails with 500 error and loops infinitely
I have an Angular application with the following features:
A login method that retrieves an access token.
A getRefreshToken method that retrieves a refresh token.
A JwtInterceptor that:
Adds the ...
2
votes
1
answer
38
views
Angular Unit Testing - Observable without Subscribing
In my auth service, I'm calling a function from angularFireAuth called onAuthStateChanged.
The documentation describes this as nextOrObserver with a 'callback triggered on change'. I understand that ...
2
votes
1
answer
44
views
Tap doesn't trigger after debounceTime when using fakeAsync in jest/angular test
I'm trying to test this flow:
Angular component:
export class AppComponent implements OnInit {
loading = true;
data$?: Observable<string>;
readonly control = new FormControl<...
0
votes
0
answers
36
views
wait two async calls to complete using NGXS dispatch
When you pass an array of actions (both an async call to an API) to the dispatch method in NGXS, does the dispatch method in NGXS internally use the forkJoin operator from RxJS to process the actions?
...
1
vote
1
answer
49
views
Is it possible to use an observable without subscribing?
Consulting articles and documentation, I saw that it is not possible to use an observable without subscribe, I have the following code in my service, why am I able to use the observable without ...
1
vote
1
answer
79
views
Angular: "Injector has already been destroyed."
Angular app with a reactive form suddenly started reporting this error:
RuntimeError: NG0205: Injector has already been destroyed.
How do I find the culprit?
1
vote
1
answer
30
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 ...
1
vote
1
answer
29
views
Most efficient way to load an array of observables (slow network requests) based on an initial observable (fast network request)?
So the situation is I load a list of objects (in this case users) to display. Most of the user data pulls very fast but the photo fetch is rather slow. Rather than pulling all of the data including ...