0

ERROR in : Can't resolve all parameters for DataService in /tmp/build_b7eed86c18aa452fb03d88946e269f3a/toshikverma-rentitnow-df48c05/src/app/services/data.service.ts: (?, [object Object]).

Circular dependency (checked)
@Injectable() (checked)
Here is my data Service class

import { BadInput } from './../common/bad-input';
import { NotFoundError } from './../common/not-found-error';
import { AppError } from './../common/app-error';
import { Http } from '@angular/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import 'rxjs/add/observable/throw';

@Injectable()
export class DataService {
 constructor(private url: string, private http: Http) { }

  getAll(obj) {
return this.http.post(this.url+"/get",obj)
  .map(response => response.json())
  .catch(this.handleError);
}
 customQuery(query) {
  console.log(this.url+"/dynamic/"+query);
return this.http.get(this.url+"/dynamic/"+query)
  .map(response => response.json())
  .catch(this.handleError);
 }
}

Am using DataService class here

import { Injectable } from '@angular/core';
import { DataService } from "./data.service";
import { Http } from "@angular/http";

@Injectable()
export class ReasonsService extends DataService {
  constructor(http: Http) {
  super("xxx/v1/reasons", http);
 }
}

I have gone through the answers mentioned on the similar question here and here, but didn't help me, I don't know what mistake am doing here, everything works fine on the local system but error when deploying on heroku using

 "postinstall": "ng build --aot -prod",

Any help would be great thanks

0 Answers0