M
M
MADSMILEXD2018-07-10 13:28:00
JavaScript
MADSMILEXD, 2018-07-10 13:28:00

Why is the link opened through the browser, but when requesting data from the same link in angular5, an error 0 appears?

The project structure is such that there is a dynamically loaded module in which there is an ngx-datable table, another module is displayed in one of the columns, and a request to the backend should leave this module, all requests outside the module work fine, but requests from this modules are not even sent, in the network section of the debugger, the code for the request is simply (failed)
the module itself is working fine, the problem is only with the request ... according to the link where the request should go, everything is also
the service code

import { Injectable } from '@angular/core';
import {HttpClient} from "@angular/common/http";
import * as appParam from "../../../../app-params";
import {Observable} from "rxjs/Observable";

@Injectable()
export class CompanyInfoHighchartService {

  constructor(private http: HttpClient) { }

    getBannerChartData(user, date, camp, banner):Observable<any> {
          let url =
              appParam.host_protocol + appParam.hostname + appParam.path
              + "method=campBannerChart&date=" + date + "&user_id=" + user
              + "&camp_id=" + camp + "&banner_id=" + banner;
            return this.http.get(url);
    }
}

5b44880d87c0f207124482.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question