Questions tagged [subject-observer]

Use this tag for questions related to an Observer for a Subject. Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.

119 questions
0
votes
1 answer

Angular : Subject is not updating the component

Subject is not updating the component. I have 2 components c1 and c2 and a service class CommonService C1 component having code related to post data. export class C1Component implements OnInit { dBservice: CommonService constructor(private…
0
votes
3 answers

Subject subscribe is not triggering in a component

When I am trying to subscribe to Subject folder_id, it is not subscribing in the board component when I am passing the id in the files component. This boardId function is triggered when a button is pressed in the files component. The activateId is…
Abhinab Roy
  • 1
  • 1
  • 2
0
votes
1 answer

not getting value from getRecipe()

I am trying to emit a subject while fetching data from another service ,but the subject is not passing the value from setRecipe() to getRecipe() and in ngOninit of the component there is not value getting from the service. @Injectable() export…
Asha
  • 1
  • 1
0
votes
1 answer

Angular communication between two components using subject

I have two angular components and need to pass in an object from one component to another on a click. My first component has the following showEventDetails(event: Event) { this.eventsService.sendEventDetail(event) } Here Event is my custom…
Karu
  • 935
  • 2
  • 13
  • 32
0
votes
2 answers

Rxjs: Observables and Subjects ordering

I have a 'User' component and its associated service : userService. I would like to use the component form for both new and edit. the User component is related to several other components (Country and State) and their Services while subscribing to …
Alexglvr
  • 427
  • 5
  • 18
0
votes
2 answers

RxJS: Emit new value whenever all subjects emit true

I have two subjects: networkStateSubject and authStateSubject. networkStateSubject emits boolean value:     true if network connectivity is enabled,     false if network connectivity is disabled. authStateSubject emits boolean value:     true if…
Ziyaddin Sadigov
  • 8,893
  • 13
  • 34
  • 41
0
votes
2 answers

Behaviour subject only shows initial value / Replay Subject does not show updated Value

Background: I have a service where I have an open layers based map. The map component has its own service. A pop up is generated when an icon is clicked. On this pop up is a button which when clicked takes some data from the object displayed on…
BEvo
  • 357
  • 6
  • 18
0
votes
1 answer

Observable of a BahaviorSubject not being emitted

I have a service the return data model. The model contains DateTime property (RelevantDateTime) - the current UTC DateTime returned from the server. I would like to use this data in a different component than the one that executes the service. I'm…
Guy E
  • 1,775
  • 2
  • 27
  • 55
0
votes
1 answer

Calling .next() on an RxJS Subject which is of array type, does not notify observer

I am building a filter, where you can filter by categories, you can select a category by clicking the checkbox next to the name of the category. So I have a filterComponent, which contains the filter it self, then a filterService, which has a…
kristof
  • 99
  • 1
  • 3
  • 11
0
votes
1 answer

How to clear previous and send only the latest value in RxJS Subject?

I have a grid in my Angular app where there are buttons in the row and on clicking the button, it opens the respective popup. I have created a service that has a property of BehaviourSubject i.e popupEventSubject$. The issue I am facing is, when I…
testacc
  • 135
  • 2
  • 12
0
votes
1 answer

Angular RXJS retry a task based on a value

Ok, so I have a service that checks to see if a particular 3rd party JS plugin has loaded. I want to listen in for when it has entered the DOM, meanwhile it is in an undefined state. How do I do that? So far I have tried using a subject and retrying…
0
votes
1 answer

Issue in fetching data from Subscriber Angular

Hi I am new to angular and was learning the concepts of observable and Subject. What I understood was that observable are event emitters to which other code can subscribe to, and Subject can both both subscribe and emit data. I tried the below code…
Amit Saha
  • 61
  • 3
  • 8
0
votes
1 answer

anugular 6 subscribe to subject from multiple component at a same time not working

I have two components(parent and child) and one service which are subscribed to a subject class at the same time. But when then subject class emit data using next method, only one component (child) is getting the data. navbar.component.ts…
Subham
  • 1,414
  • 4
  • 17
  • 34
0
votes
1 answer

Angular Subject not listening to changes

I have a Mat table which is getting data by Http get. I populate the table initially once the page is loaded and then when a search is done. My Table gets Populated initially but when the data source is updated,table is not rendered with updated…
Rahat Saini
  • 311
  • 1
  • 4
  • 15
0
votes
1 answer

Consume service in different components not working

I have a side navigation bar and a content div. What I currently want to achieve is that whenever I click on any element in side nav. The innerText of that nav item should be displayed in the content div. My code is as…
VIBHOR GOYAL
  • 473
  • 1
  • 6
  • 22