comment étendre le service avec dépendances angulaire 2

J'ai un service parent qui a des dépendances comme

@Injectable()
export class ParentService{
  constructor(private http:Http, private customService:CustomService){}
}

et je veux étendre le service

@Injectable()
export class ChildService extends ParentService{
  constructor (){
    super(??) <= typescript now asking to enter two parameters according to ParentServie's constructor
  }
}

Modifier-----------------

@Injectable()
export class ParentService{
  constructor(private http:Http, private customService:CustomService){}
  get(){this.http.get(...)}
}

@Injectable()
export class ChildService extends ParentService{
  constructor (private http:Http, private customService:CustomService){
    super(http, customService)
  }
}

Alors je peux utiliser dans les composants?

export class Cmp {
  constructor(private childService:ChildService){
    this.childService.get()
  }
}

OriginalL'auteur Han Che | 2016-08-29