@Injectable()
export class APIService {
constructor(private http: Http) {
}
}
@Injectable()
export class CourseAPIService extends APIService{
constructor(private http2: Http){
super(http2);
}
}
我有baseclass作爲具有Http作爲構造函數參數的APIService不幸我必須在子類CourseAPIService中再次傳遞它。 如果有任何soln ...請幫幫我嗎?如何避免在TypeScript,Angular2派生類中重複基類構造函數參數?