¿Cómo puedo acceder al res.groupId
desde otro suscribe
?
this.route.params.subscribe(params => {
this.userId = (params.id) ? params.id : null
if(this.userId){
this._userService.view(this.userId).subscribe(res => {
let users = <User[]>res;
this.registerForm.controls['client'].setValue(res.clientName);
this.registerForm.controls['em'].setValue(res.email);
this.registerForm.controls['pass'].setValue(res.password);
this.registerForm.controls['ph'].setValue(res.phone);
this.registerForm.controls['groupId'].setValue(res.groupId);
});
}
});
this._operatorgroups.index().subscribe(res => {
let operatorGroups = <OperatorGroups[]>res;
this.operatorGroups = operatorGroups;
if(this.userId) this.registerForm.controls['groupId'].setValue(res[res.groupId].id);
});