279 questions
2
votes
1
answer
92
views
Why is it easy to check .closed on manual RxJS subscriptions, but not with takeUntilDestroyed() in Angular?
I am using RxJS for subscriptions in Angular. I noticed that when I manually subscribe to an observable and store the Subscription, I can easily check if it was unsubscribed using .closed, especially ...
1
vote
2
answers
85
views
Question about managing Observables in Angular 14
I'm new to Angular and right now I'm using Angular 14 and I have a problem that happens to me often.
For example, I have an array and I make a for loop to go through each of its indexes and I make a ...
1
vote
4
answers
224
views
Component making duplicate api 'GET' requests with behaviorsubject
I am working on an angular v14 application and I am having trouble figuring out how to fix an issue with my component making duplicate api calls.
I have a service that is shared between all components ...
2
votes
1
answer
66
views
Function which returns RxJs boolean observable - emit single value and complete
I have several functions in an angular project which return a boolean observable. Some of these functions could simply return an immediate result, but could also contain nested observables that open ...
1
vote
1
answer
2k
views
Difference between observable toSignal AND updating Signal value inside the subscribe of Observable
Are there any differences or advantages or proper way to do this?
Let's say I have an observable, I may receive it from backend call, a service or through a GUI event like scrolling event.
I have a ...
1
vote
1
answer
82
views
Form Control valueChanges observable in NgOnInit cannot be subscribed after navigating to same page
I have a page that navigates to itself with different parameter. This makes the NgOnInit don't be executed again. Sadly, in the NgOnInit I have an observable subscribed to deal with value changes in a ...
1
vote
1
answer
2k
views
Angular 17 - How to use async values in object using new @if syntax
In the previous *ngIf directives we were able to chain multiple async operations to not repeat the async pipe in the template but to reuse them later as one subscription, now I want to use the same ...
1
vote
1
answer
44
views
Unit Test case to mock Behavior Subject in Store
I have created a store to load address detail in behavior subject
@Injectable({
providedIn: 'root'
})
export class AddressStore {
private subjectAddress = new BehaviorSubject<Address[]>([...
1
vote
2
answers
107
views
Why does my observable doesn't catch error and stops working
I have a form. The user enters inputs and then a http request is sent to the backend to get data.
In the HTML template I have
data$ | async
In the component code I first have:
data$: Observable<...
2
votes
0
answers
1k
views
Display issue with an observable in Angular 17: the page loads indefinitely
I'm encountering an issue with Angular 17 where the use of an observable in my template seems to cause an indefinite loading of the page without displaying any errors in the browser console. This ...
0
votes
1
answer
640
views
Display loader only when api call will be longer then 1 sec
I have tried and I still trying to create a mechanism in Angular using rx that will display my loader, but only if the API call is longer than 1 second, if it is shorter I would not like to display it....
0
votes
2
answers
48
views
Can't pull json data from service into component to display
New to Angular and I'm trying to follow a tutorial. I'm pulling data into a shared service via an http call but from there I can't seem to get it into my component to be displayed in a table. I can ...
0
votes
2
answers
49
views
Which is the correct way to deal with an observed dependency?
I'm using Angular 15 and @angular/fire ^7.5.0 for my project.
I have a service that makes some calls to the Firestore database, but before i perform any action i need to recover some information from ...
0
votes
1
answer
276
views
Can't get through with async validators
So, I have a blog, and I'm trying to setup a check, on the creation of a new text, to lock the form if the title already exists.
I got a TextService
export class TextService {
private _url = "...
1
vote
1
answer
2k
views
How to get token from oidc-client-ts (Angular) [closed]
auth.service.ts
import { Injectable } from '@angular/core';
import { User, UserManager } from 'oidc-client-ts';
import { SettingsService } from './settings.service';
import { Observable, from } from '...