ngOnInit(): void {
this.appData$ = this.dataService.getAppData()
}
getCustbuttonPressed(): void {
let id= this.appData$.subscribe(r => r.id)
const request: CustRequest = {
name: 'some name',
id: id // <-- this throws 'Type 'subscribe' cannot assign to type 'string'
}
this.service.getcustomer(request).subscribe(response => {console.log(response)})
}
Basically I want to wait for the value and set it before sending the request. How do I do it correctly?