0

I can't seem to find why it would do this. I have a base class that most of my class inherit from.

import { Http, HttpModule, Response, Headers} from '@angular/http';

export class ServiceBase {
 constructor(private http:Http){}
}

I have a child class, if I just call super(), I get an error that my parameters does matched, after much research, it appears that I have to pass http into Super base the parent class has it. Hence, create http:Http and pass it to super and I get the following error.

"can't resolve parameters".

How do I resolve this?

import { Http, HttpModule, Response, Headers} from '@angular/http';

export class childService extends ServiceBase {
   constructor(private http:Http){
       super(http) // Can't resolve all parameters for parent class
   }
}
Narendra Jadhav
  • 10,052
  • 15
  • 33
  • 44
Thaison Nguyen
  • 131
  • 1
  • 10
  • Possible duplicate of [Inheritance and dependency injection](https://stackoverflow.com/questions/39038791/inheritance-and-dependency-injection) – Chiller Jun 12 '18 at 16:41
  • You'd need to make those Services `Injectable` to inject `Http` – Chau Tran Jun 12 '18 at 20:38

0 Answers0