Questions tagged [rxjs-observables]
759 questions
0
votes
1 answer
Angular - would observables benefit me in a basic HTTP POST request vs promises?
I'm writing an app with Angular 8. I'm kind of new to the framework coming from AngularJS. I have a lot of experience with Promises.
I have HTTP requests to my backend API. These are just GET & POST calls as there aren't any WebSockets in our Delphi…

user1261710
- 2,539
- 5
- 41
- 72
0
votes
2 answers
Return the "long_name" for the item that has types "locality"
I'm trying to print out the long_name for the item that has types === "locality". I'm using Angular and httpClient, which makes an observable. I'm lost in the complexity of rxjs and js.
Can anyone help?
Service:
getGoogleGeo2(postalCode: string) {
…

artworkjpm
- 1,255
- 2
- 19
- 40
0
votes
1 answer
How can I unsubscribe from Observable/Subject on the first emission while defining the observer
I am working on some dialogs with angular 9 and I came into a situation where I need to unsubscribe from a Subject after the first emission.
Initially, I thought of piping the subject using the take(1) or first() operator and subscribe to this…

flyer88
- 1,073
- 3
- 15
- 33
0
votes
1 answer
How to set current index of or move backwards though an rxjs observable?
I'm using an rxjs observable to model a sequence of steps that occurs in my app.
Pseudocode
const steps = [{id: "step1"}, {id: "step2"}, {id: "step3"}]
//... then at some point later do things based on the steps
from(steps).pipe(
…

imagio
- 1,390
- 2
- 16
- 27
0
votes
1 answer
How can I get a value from an observer inside another?
How do I make this line return a value in the subscribe ? It is returning an observable instead:
let test = undefined;
of(test, this.myService.whatever(var1, var2))
.pipe(
first(n=>!!n)
).subscribe(result=>console.log(result)); //…

Nelson Teixeira
- 6,297
- 5
- 36
- 73
0
votes
2 answers
how to combine multiple observables on first observable complete and return as new observable in method
I am a beginner to use RxJs operators and I am having a requirement of a method, which calls 5 observables from service and it should fetch data from service only after first observable completes, then combine all the observables and transform to a…

Viswa
- 745
- 10
- 30
0
votes
1 answer
how to use multicasting obs with behavioursubject?
In general we need behavior subject functionality. But only on first subscription we should send subscribe to server in REST. And to send unsubscribe on the last unsubscribe, and all late observers subscribed will gwt the latest json recwived from…

Shaul Naim
- 246
- 3
- 15
0
votes
0 answers
asynchronous execution issue while fetching ip address in angular service call
I am writing a log service, in the log service have several log info. if I fetch IP address, it will fetch IP address after some delay, IP address as undefined in the error object.because
logError(response: any): any {
let errors:any;
…

Mohamed Sahir
- 2,482
- 8
- 40
- 71
0
votes
1 answer
Observable transformation to handle backend server error
Apologies for the newbie/dump question about RxJS, just started since I am learning Angular.
So I've created an asynchronous validator static method that calls an API service method checking the uniqueness of username in the database. The code…

David B
- 3,269
- 12
- 48
- 80
0
votes
2 answers
RxJS http request made multiple times
I have attached an open() method to my ng-select element in order to populate it with data from an external API.
The problem I encountered: if I open the dropdown 5 times and then I type a letter, it will make 5 http requests to the server in order…

shAkur
- 944
- 2
- 21
- 45
0
votes
3 answers
subscribing to multiple observable while keeping reference to function parameters
I have an input of a string array for Enums I want to recieve from server:
enumList = ['somethin','branch','country', 'serviceType', 'thatandthis'];
I then have a generic http-service method that takes an enumList string as a parameter and returns…

Tomas Katz
- 1,653
- 1
- 13
- 27
0
votes
1 answer
Textbook[ ] is undefined after setting it equal to subscribing to Observable
Heres how I am calling the GET HTTP method:
getTextbooks() :Observable {
return this.http.get('http://localhost:3000/catalogue');
}
Which parses the HTTP response to Textbook[] and returns an observable
I then subscribe…
user7299402
0
votes
1 answer
Make an Behaviorsubject for nested serializer's data
I try to make an articles app.
based on angular and ionic but the problem I face is the programming structure for Behaviorsubject for the serializer nested data.
My backend uses django-rest-framework
*I successfully perform "CRUD" operations (I.e.…

HeRo
- 21
- 1
- 5
0
votes
2 answers
RxJs operators and Angular: using async pipe and tap does not populate data
Here is my code snippet:
In Typescript:
isDataSearch = false;
getDatacollectionByID() {
const params = {
id: ,
};
this.metaData = this.dataService.getDatacollectionByID(params)
.pipe(
pluck('level1', 'level2',…

pixlboy
- 1,452
- 13
- 30
0
votes
1 answer
Angular 5 + RxJS: using observables in the component without subscribing to them
I normally tend to use Observables in components by passing them into functions through template using myFunction(myObservable$ | async) and it works quite well.
However, in my template I have an output function that emits values to the parent…

ignite-me
- 738
- 3
- 14
- 33