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
-1
votes
2 answers

Cannot use child input value in parent's [ngClass] logic

I am attempting to pass the user input value from my input through to the parent and use this value to determine which row to highlight within my
  • physicsboy
    • 5,656
    • 17
    • 70
    • 119
  • -1
    votes
    2 answers

    How to emit router event

    I have 2 modules, one is sidenav, where I can select the menu and want to show component in content module where have router-outlet. I want to know what is the best way to do that? Have some router event where I can just subscribe in content module?…
    Chiien
    • 341
    • 1
    • 3
    • 14
    -1
    votes
    3 answers

    Angular - emitted event doesn't get through to parent component

    I'm trying to emit an event from a child component to a parent component. Here is part of the parent file TS file: import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-car-detail', templateUrl:…
    Matt
    • 556
    • 8
    • 31
    -1
    votes
    1 answer

    Not able to bind click event in @Directive in angular4

    I have a simple Directive like this import { Directive, HostListener, EventEmitter, Output } from '@angular/core'; @Directive({ selector: '[appAppClick]' }) export class AppClickDirective { @Output() clickDirective: EventEmitter = new…
    Lijin Durairaj
    • 3,341
    • 11
    • 31
    • 50
    -1
    votes
    1 answer

    Accessing an object's parent (or instance?) given a sub-object

    I have an object variable a, which has an array associated with it, b. I am passing b to a function and need to check properties in a, the object it's associated with. How can I do this? Can I somehow use an event emitter? function ObjectB…
    timdirusso
    • 51
    • 1
    • 8
    -1
    votes
    2 answers

    Event doesn't bubble to parent component

    I have the following project structure: todo-form fires created event and I want to handle this event in todos component todo-form.component.html:
    gstackoverflow
    • 36,709
    • 117
    • 359
    • 710
    -1
    votes
    1 answer

    warning: possible EventEmitter memory leak detected. 11 AppUp > listeners added. Use emitter.setMaxListeners() to increase limit

    I'm using the following event emitter (and I need this functionality). My question is how to avoid the error. It seems that I'm using event inside another event. warning: possible EventEmitter memory leak detected. 11 AppUp listeners added. Use…
    07_05_GuyT
    • 2,787
    • 14
    • 43
    • 88
    -1
    votes
    1 answer

    Event emitter doesn't emit events

    I've module like following which I want to emit event like this: file aa.js var EventEmitter = require("events").EventEmitter, eventEmitterIns = new EventEmitter(); var preProcess = function (cb) { ... var start = function () { …
    07_05_GuyT
    • 2,787
    • 14
    • 43
    • 88
    -1
    votes
    1 answer

    Events in Node.js

    First example from https://nodejs.org/dist/latest-v5.x/docs/api/child_process.html is as follows: const spawn = require('child_process').spawn; const ls = spawn('ls', ['-lh', '/usr']); ls.stdout.on('data', (data) => { console.log(`stdout:…
    mrs
    • 11
    -1
    votes
    1 answer

    How handle multiple objects with EventEmitter - NodeJS

    Main File var DogModule = require('Dog'); var dogsList = []; function addNewDog(){ var newDog = new Dog(); dogsList.push(newDog); } ???.on('bark', function(barkSound) { console.log(barkSound); }); Dog File var EventEmitter =…
    Xplouder
    • 148
    • 1
    • 4
    • 13
    -1
    votes
    2 answers

    Publisher / Subscriber model in ReactJS

    Does ReactJS have a publisher / subscriber model similar to EventEmitter in node?
    Olshansky
    • 5,904
    • 8
    • 32
    • 47
    -2
    votes
    1 answer

    How to persist EventEmitter object in node application?

    I am connecting external websockets in my application. In those sockets I am firing EventEmitters. But, when I make update to my application all living Events dying. I want them to be alive as long as I remove them. I tried redis pub/sub, result is…
    beratuslu
    • 1,101
    • 3
    • 14
    • 27
    -2
    votes
    1 answer

    Process multiple POST requests with emitters/listeners

    Code: app.post('/new', urlencodedParser, function (req, res) { if (!req.body) return res.sendStatus(400); emitter.on('response', function (output) { res.status(200).json({ip: `${output}`, id: `${random_id}`}); }); }); Problem: The…
    Darwesh Singh
    • 31
    • 1
    • 7
    -2
    votes
    1 answer

    Nodejs EventEmitter & load balancing

    I heard someone says 'EventEmitter becomes an issue the moment you decide to load balance. I haven’t used it in 4 or 5 years because I’m always clustering my Node apps' Is there a relationship between 'EventEmitter' and 'load balance'? Is it true?
    -3
    votes
    1 answer

    Sending data between components in Angular4

    Is there any alternative for @Input() and @Output() for sending data between components in angular?
    Rishi RD
    • 1
    • 1
    1 2 3
    63
    64