All Questions
Tagged with angular5 observable
105
questions
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....
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 ...
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 ...
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 ...
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....
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 ...
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 ...
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.
...
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, ...
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 ...
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'])
....
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....
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. ...
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 ...
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 ...