Questions tagged [eventemitter]

An event emitter is a platform for triggering and listening for events.

An event emitter is a platform for triggering and listening for events. Different libraries offer different implementations and for different purposes.

960 questions
0
votes
0 answers

Create personal EventEmitter class

I need to create an EventEmitter class with constructor() and on(eventName, callback) methods. Also have to make Movie a subclass of EventEmitter and use the inherited methods to publish play event when the method is called. I don't know how to…
boludo kid
  • 154
  • 1
  • 12
0
votes
2 answers

EventEmmiter send data to no sibling component - Angular 2

I had one component that consisted of button that triggers function and table that generate elements according to data that i got from service and that function. But I had to split that component, and now i have only button on one component, and…
John Theoden
  • 325
  • 2
  • 10
  • 23
0
votes
0 answers

How can I test an async event emitter using mocha and TypeScript?

I'm having trouble getting an async event emitter test running in mocha v5.0.4. I'm using a typed Rx based event emitter and node.js v8.10. Can anyone point me in the right direction please? The first and the second it-blocks work fine. However,…
hurb
  • 2,177
  • 3
  • 18
  • 32
0
votes
1 answer

angular 5 EventEmitter give nothing

Please, help me understand why EventEmitter in my example won't work. I can't see mistakes in my code, but still it won't work. I have no errors and no effect. app.menu.ts (child component): import { Component, Input, EventEmitter, Output } from…
Eva
  • 188
  • 1
  • 4
  • 19
0
votes
1 answer

Adding multiple listeners to one EventEmitter on Node server

I have node.js server, and clients connecting by AJAX HTTP long polling request. I want to create one EventEmitter object and I want to add every new client to this object after received request from him. What is proper way to do this? In other…
m.mikolajczak
  • 124
  • 1
  • 2
  • 11
0
votes
2 answers

How to get response from EventEmitter

I called one method from child. In child component: @Output() parentEvent = new EventEmitter(); click1() { //calling the method from child this.parentEvent.emit(myObj1); } In parent component: postMethod1(event) { //calling…
vik
  • 105
  • 13
0
votes
1 answer

Cascade operation (using EventEmitters) for dropdown angular 2

I've several drop-downs on a form that works in cascading effect - first dropdown controls the values to be shown in the second dropdown and so on. The values for each dropdown comes from an async data service(s). I am using Angular EventEmitter to…
shankys
  • 67
  • 1
  • 10
0
votes
0 answers

NodeJs EventEmitter get listeners check if listener is of type on or once

I am using node v8.9.4 and I want to get listeners of an EventEmitter in order to reattach them to another EventEmitter (I use an API that can handle only one EventEmitter as parameter but got have to handle one internal emitter and one external…
Jankapunkt
  • 8,128
  • 4
  • 30
  • 59
0
votes
2 answers

how to make the contents of home page to change when signUp with user page in angular4

The contents of home page and user page are displayed on the home page itself. In the header section i have SignIn and SignUp form from home.html. I have another Signup form from user page, where in i have 3 buttons, signUp with facebook, signUp…
Bhrungarajni
  • 2,415
  • 11
  • 44
  • 88
0
votes
1 answer

Should my in-browser data models be singletons?

I am doing a React app and I want to do my in memory data models with es6 modules and EventEmitter. Wondering if it is recommended to use a singleton. Also I heard that this event emitter is the one to use.
user2355058
  • 211
  • 3
  • 15
0
votes
1 answer

How to make a common event bus to interact two angular4/5 app in single-spa

I am trying to make two Angular apps and i want an event emitter to listen events commonly in between two different application with Single-spa otherwise known as MicroFrontend for multiple js framework but i am unable to find any possible solution…
0
votes
2 answers

angular 2 child component not getting input data

in my case i am trying to emit an event with data from one child of the parent to another child of the same parent. basically between siblings. the code looks like Child A @Output() makeIsrCall = new EventEmitter() startCall(){ …
Vik
  • 8,721
  • 27
  • 83
  • 168
0
votes
1 answer

Angular 2 EventEmitter apparently not emitting in test

This is starting to feel bewitched. After having read the Angular guide multiple times today, I cannot get my test to pass, and cannot figure out why. stackblitz example (of course here the spy expectation works, but not the other…
redOctober13
  • 3,662
  • 6
  • 34
  • 61
0
votes
0 answers

Angular 2: How to Test Subscribing to an Event Emitter in an Entry (Imperative) Component?

It may be that my components just aren't structured correctly, although they work as needed when running the app; I just can't get my test to pass. Parent component (I'm using an ng-bootstrap modal; this function is called on a button click): …
redOctober13
  • 3,662
  • 6
  • 34
  • 61
0
votes
2 answers

@Output with EventEmitter from child to parent, view doesn't update in parent

When a marker is clicked in map.component.ts, it emits the data to home.component.ts. This is detected by this line So when updateSelected is run it updates opened to true. When checking the console…
user6885115