Skip to main content

All Questions

Tagged with
1 vote
1 answer
6k views

Subscribe to one observable twice from a component doesn't work

I got several components subscribing to my data service and they are all working fine. But in one of my components, I try to subscribe twice (inside ngOnInit and ngAfterViewInit) but this doesn't work....
Fth's user avatar
  • 115
0 votes
1 answer
2k views

How to prevent Observable error propagation?

I have a service that I use to auto-fetch data at regular intervals: export class ApiService { interval$: BehaviorSubject<number> = new BehaviorSubject<number>(0); // Feed a 0 ...
Gillespie's user avatar
  • 6,271
1 vote
1 answer
3k views

How to return boolean value from a function that subscribes to an observable of another function?

I'm having this problem, I have a ProductService that has a boolean function validateProductsBeforeChanges. Inside validateProductsBeforeChanges I call a function from another service called ...
Ignacio Mariano Chiodo's user avatar
0 votes
1 answer
1k views

Return Observable of single item from http.get in Angular 5

I have a service that sends requests to an in-memory-web-api. The service includes a method which I want to query (via query string) the API for a single item. Regardless of specifying a single item ...
TonE's user avatar
  • 3,025
0 votes
1 answer
132 views

Angular route component doesn't get updated destroyed and loaded again

I got an issue with angular 2+ when a component is loaded then changed to another route, and then loaded again. I got following code loading an array which then gets loaded in ngFor. this.sub = this....
Eriendel's user avatar
  • 939
0 votes
1 answer
21 views

angular5 how to make asyc request?

In my project i made multiple request to server to get data for single page. I want to make all request asyc. Right now until i get the response from first request,the response of second request is ...
Palak Jadav's user avatar
  • 1,234
3 votes
1 answer
1k views

How to periodically poll information in Angular 5 using Observables and also have immediate fetch using RxJs 5.x?

I am coding a Single Page Application in Angular 5 and it requires to periodically check if API still has the same version as when the SPA was loaded to inform the user about the desync and allow her ...
Alexei - check Codidact's user avatar
2 votes
0 answers
50 views

Observable on one parent node vs multiple sub node Firebase angular 5

I have a confusion regarding Firebase observable in angular, here is structure I want to watch all chats of particular user who logged in to my app, and I am seeing two option for achieve this. ...
Nishant Dixit's user avatar
2 votes
0 answers
131 views

Multiple observable in Route guard but wait for only one - Angular 5

I have a route guard in my application in which i need to check for two observables if anyone is success i should allow the route or block. Route guard : canActivate(route: ActivatedRouteSnapshot, ...
Keshav1007's user avatar
2 votes
3 answers
2k views

Angular 5 wait for multiple child notifications

I have a parent component that includes two child components. Each of the children has their own network load, and I need to know in the parent component when both children are done with their ...
Gargoyle's user avatar
  • 10k
0 votes
2 answers
66 views

Angular 5 convert Observable<obj> to obj

I'm implementing resolve method: resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Obj> | Obj { return this.service.get(route.params['guid']) ....
A. Gladkiy's user avatar
  • 3,322
6 votes
2 answers
5k views

Server Sent Events Error : 406 (Not Acceptable) in Angular5 + Spring App

I am working with Angular5 application , where i need to show Real-time data on dashboard.our backend is written in spring(v4.x) which having api which sends results when any server event is generated....
Bhagvat Lande's user avatar
1 vote
1 answer
10k views

Subscribe method get call multiple times Angular 5

I have one method subscribed in ngOnInit of controller.ts. From the view, there is an option to select the different user from listing which redirects to the same page just ID from URL gets changed. ...
A. A.'s user avatar
  • 143
0 votes
2 answers
2k views

Angular Observable using a counter

I am currently learning about asynchronous angular. I have some code below inside a function and inside a for each loop. I would like to find out the number of successful requests then produce a ...
theonestine's user avatar
0 votes
1 answer
1k views

Return a boolean from subscribe in a Guard in Angular 5

I'm trying to return a true in case the subscribe returns me data. Then if error i want it to return me false. More in deep, my subscribe returns me if theres a cookie or not. If has cookie i want to ...
Alberto Molina's user avatar

15 30 50 per page
1
2 3 4 5
7