Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

246
Views
cómo recopilar datos de la plantilla y preparar la solicitud posterior del artículo exacto

Obtengo datos de usuario del backend y necesito cambiar la información exacta del usuario y enviarla al backend, hago parte de la interfaz de usuario con select y etc., por lo que la pregunta es:

¿Cómo recopilar datos modificados para un elemento exacto de la plantilla sin formulario y preparar un cuerpo de solicitud posterior?

perdon si me expliqué mal. revisa el código de abajo!

 export class UsersComponent implements OnInit { public isLoading: boolean = true; public firstLoading: boolean = true; public langChangeObs: Observable<number | null> = this.storeService.selectedLangId; public users: IUserManagement[] = []; public roles: IRolesList[] = []; // @ts-ignore private langId: number; private ngUnsubscribe: Subject<void> = new Subject<void>(); constructor(private storeService: StoreService, private http: HttpClientService) { } ngOnInit(): void { this.subscribeToChangeLang(); this.getData(); } private subscribeToChangeLang() { this.langChangeObs.pipe( takeUntil(this.ngUnsubscribe) ).subscribe(langId => { this.langId = langId as number; }); } private getData() { this.http.getUsers(this.langId).subscribe((data: any) => { console.log(data); this.users = data.users.data; this.roles = data.roles.data; }); } public sentUserChange() { } ngOnDestroy(): void { this.ngUnsubscribe.next(); this.ngUnsubscribe.complete(); } }
 <nb-card size="large"> <nb-list> <nb-list-item class="users" *ngFor="let user of users"> <div> <nb-user [name]="user.name"> </nb-user> </div> <div> <span class="label">Email:</span> <input nbInput type="text" [(ngModel)]="user.email"> </div> <div> <span class="label">Role:</span> <nb-select class="role-select" size="small" placeholder="{{user.role.role}}" [(selected)]="user.role.role"> <nb-option *ngFor="let role of roles" [value]="role.id">{{role.human_readable}}</nb-option> </nb-select> </div> <div> <button click="sentUserChange()" nbButton>Save</button> </div> </nb-list-item> </nb-list> </nb-card>

imagen de la interfaz de usuario

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!