1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular not able to call service from eventhandler

Discussão em 'Angular' iniciado por edwin joseph, Junho 18, 2025.

  1. edwin joseph

    edwin joseph Guest

    Inside the ngOnInit() I am initializing a event

    if (!window.addEventListener)
    {
    this.window.attachEvent('onmessage', this.eventHandler.bind(null, this.router));
    }
    else
    {
    window.addEventListener('message', this.eventHandler.bind(null, this.router), false);
    }


    and inside the eventHandler as shown below I try make a call to service but the service is not being called

    eventHandler = function (router, e)
    {
    if (response.type === "PAGE_LOAD" && response.data.pageName === "DOC")
    {
    this.BuilderService.deleteUser(this.filter).subscribe(data => this.success(),(err) => this.handleError(err.statusText));
    }
    }


    Could someone please help me fix this issue?

    Continue reading...

Compartilhe esta Página