Just move the things that depend on the id
into the subscribe callback:
getCustbuttonPressed(): void {
this.appData$.subscribe(r => {
const request: CustRequest = {
name: 'some name',
id: r.id
}
this.service.getcustomer(request).subscribe(response => {console.log(response)})
})
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…