I have a class called restService like bellow:
@Injectable({
providedIn: 'root'
})
export class RestService {
private baseUrl: string;
constructor(private http: HttpClient) {
this.baseUrl = environment.jsonServerUrl;
}
}
and I have another class extends RestService class called UploaderService like this:
@Injectable({
providedIn: 'root'
})
export class UploaderService extends RestService {
constructor() {
super(); // error occurred here!
}
}
but when I write super method error occurred because RestService Class has Dependency Injection in its constructor, and I don't know how can I inject that in the super. How can I fix that?
UploaderServicedoes nothing, you could drop it altogether.