Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot emit from another module #1

Open
ks221197 opened this issue Jun 6, 2022 · 1 comment
Open

Cannot emit from another module #1

ks221197 opened this issue Jun 6, 2022 · 1 comment

Comments

@ks221197
Copy link

ks221197 commented Jun 6, 2022

i am trying to emit event from another folder
eg.
├── src
├── index
├── index.controller.ts
├── index.module.ts
├── index.service.ts

├── app.controller.ts
├── app.module.ts
├── app.service.ts

index.controller.ts

import { Controller, Get } from "@nestjs/common";
import { EventsService } from "src/events.service";

@Controller()
export class IndexController {
  constructor( private readonly eventService: EventsService) {}

  @Get()
  async index() {
    this.eventService.emit({ emitting: new Date().toISOString() })
    return {fgh: 'fgh'}
  }
}

, but client doesn't receive any event emitted from index.controller

@dekkaladiwakar
Copy link

There is no 'events.service' file in your File Structure mentioned above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants