Answer the question
In order to leave comments, you need to log in
How to inherit a constructor?
I don't really understand how to properly use IoC in service inheritance. There is a basic service:
export abstract class BaseService {
protected constructor(protected httpClient: HttpClient) {}
}
export class AuthService extends BaseService {
getMember() {
return this.httpClient.get('/member');
}
}
protected constructor(protected httpClient: HttpClient) { super(httpClient); }
Answer the question
In order to leave comments, you need to log in
export abstract class BaseService {
protected httpClient: HttpClien
}
export class AuthService extends BaseService {
constructor(
protected httpClient: HttpClien
) { super() }
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question