-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,10 @@ | |
matInput | ||
placeholder="Nome" | ||
[(ngModel)]="laboratorio.nome" | ||
name="name" | ||
name="nome" | ||
/> | ||
</mat-form-field> | ||
|
||
<mat-form-field appearance="fill"> | ||
<input | ||
matInput | ||
|
@@ -17,12 +18,28 @@ | |
name="serie" | ||
/> | ||
</mat-form-field> | ||
|
||
<mat-form-field appearance="fill"> | ||
<mat-label>Laboratório domínio</mat-label> | ||
<mat-select | ||
[(ngModel)]="laboratorio.laboratory_domain_id" | ||
This comment has been minimized.
Sorry, something went wrong.
wellington1993
Collaborator
|
||
name="laboratory_domain_id" | ||
> | ||
<mat-option | ||
*ngFor="let laboratoryDomain of laboratoryDomains" | ||
[value]="laboratoryDomain.id" | ||
This comment has been minimized.
Sorry, something went wrong.
wellington1993
Collaborator
|
||
> | ||
{{ laboratoryDomain.name }} | ||
</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
|
||
<mat-form-field appearance="fill"> | ||
<input | ||
matInput | ||
[matDatepicker]="criado_em" | ||
placeholder="Criado em" | ||
[(ngModel)]="laboratorio.criado_em" name="criado em" | ||
[(ngModel)]="laboratorio.criado_em" name="criado_em" | ||
required | ||
/> | ||
<mat-datepicker-toggle | ||
|
@@ -32,6 +49,7 @@ | |
<mat-datepicker #criado_em></mat-datepicker> | ||
</mat-form-field> | ||
</form> | ||
|
||
<button mat-raised-button (click)="updateLaboratorio()" color="primary"> | ||
Salvar | ||
</button> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import { LaboratoryDomain } from './../../model/laboratory-domain.model'; | ||
import { LaboratoryDomainService } from '../../laboratory-domain/laboratory-domain.service'; | ||
This comment has been minimized.
Sorry, something went wrong.
wellington1993
Collaborator
|
||
import { Component, OnInit } from '@angular/core'; | ||
import { ActivatedRoute, Router } from '@angular/router'; | ||
import { Laboratorio } from '../../model/laboratorio.model'; | ||
|
@@ -10,9 +12,11 @@ import { LaboratorioService } from '../laboratorio.service'; | |
}) | ||
export class LaboratorioUpdateComponent implements OnInit { | ||
laboratorio!: Laboratorio; | ||
laboratoryDomains: LaboratoryDomain[] = []; | ||
|
||
constructor( | ||
private laboratorioService: LaboratorioService, | ||
private laboratoryDomainService: LaboratoryDomainService, | ||
private router: Router, | ||
private route: ActivatedRoute | ||
) { } | ||
|
@@ -24,6 +28,12 @@ export class LaboratorioUpdateComponent implements OnInit { | |
.subscribe((laboratorio) => { | ||
this.laboratorio = laboratorio; | ||
}); | ||
|
||
this.laboratoryDomainService | ||
.read() | ||
.subscribe((laboratoryDomains) => { | ||
This comment has been minimized.
Sorry, something went wrong.
wellington1993
Collaborator
|
||
this.laboratoryDomains = laboratoryDomains; | ||
}); | ||
} | ||
|
||
updateLaboratorio(): void { | ||
|
1 comment
on commit 2a93196
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: @RogerDelNobre Revisar itens dos comentários, principalmente a questão do Unsubscribe e do async.
@RogerDelNobre Estudar sobre async e sempre fazer o unsubscribe.