eventemitter

possible EventEmitter memory leak detected

笑着哭i 提交于 2019-11-26 01:13:48
问题 I am getting following warning: (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. Trace: at EventEmitter.<anonymous> (events.js:139:15) at EventEmitter.<anonymous> (node.js:385:29) at Server.<anonymous> (server.js:20:17) at Server.emit (events.js:70:17) at HTTPParser.onIncoming (http.js:1514:12) at HTTPParser.onHeadersComplete (http.js:102:31) at Socket.ondata (http.js:1410:22) at TCP.onread (net.js:354:27) I wrote

Delegation: EventEmitter or Observable in Angular

ぃ、小莉子 提交于 2019-11-25 21:47:28
问题 I am trying to implement something like a delegation pattern in Angular. When the user clicks on a nav-item , I would like to call a function which then emits an event which should in turn be handled by some other component listening for the event. Here is the scenario: I have a Navigation component: import {Component, Output, EventEmitter} from \'angular2/core\'; @Component({ // other properties left out for brevity events : [\'navchange\'], template:` <div class=\"nav-item\" (click)=\