I am migrating my app from Angular 3 to Angular 7,
Ionic 3 to Ionic 4
There are two services BaseHttpService
which is mainly responsible for Http calls and AppService
which extends the BaseHttpService
to make calls.
In the migration Docs, it is mentioned to use { providedIn: "root" }
in services.
But the base and parent class in services is nowhere mentioned.I tried many approaches but didnt went through.
I have a parent service which has some dependencies like
export abstract class BaseHttpService implements OnInit {
private baseUrl: string = Constants.BASEURL;
protected method: string;
protected serviceUrl: string;
protected headers: Headers;
constructor(private http:) {
this.headers = new Headers();
this.headers.append('Content-Type', 'application/json')
this.headers.append('Accept', 'application/json');
}
}
and I want to extend the service
@Injectable({ providedIn: "root" })
export class AppService extends BaseHttpService{
constructor(private _http: Http, ) {
super(_http);
}
But it is throwing error while running on browser