parent
bd75ddd3c0
commit
1058fb0a7e
@ -0,0 +1,8 @@ |
|||||||
|
<div class="row mb-2"> |
||||||
|
|
||||||
|
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-3"> |
||||||
|
|
||||||
|
<label for="agence-name" class="form-label">Nom</label> |
||||||
|
<input class="form-control" id="agence-name" [(ngModel)]="agence.name" placeholder="name"> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,31 @@ |
|||||||
|
import {Component, Input, OnInit} from '@angular/core'; |
||||||
|
import {Agence} from "../../../interfaces/agence"; |
||||||
|
import {HttpClient} from "@angular/common/http"; |
||||||
|
import {AgenceService} from "../../../services/agence.service"; |
||||||
|
@Component({ |
||||||
|
selector: 'app-agence-detail', |
||||||
|
templateUrl: './agence-detail.component.html', |
||||||
|
styleUrls: ['./agence-detail.component.scss'] |
||||||
|
}) |
||||||
|
export class AgenceDetailComponent implements OnInit { |
||||||
|
|
||||||
|
agences : Agence[] = []; |
||||||
|
@Input() |
||||||
|
agence = {} as Agence ; |
||||||
|
|
||||||
|
constructor( |
||||||
|
private http : HttpClient, |
||||||
|
private agenceService: AgenceService, |
||||||
|
) { } |
||||||
|
|
||||||
|
ngOnInit(): void { |
||||||
|
this.getAgences(); |
||||||
|
this.getAgences(); |
||||||
|
} |
||||||
|
|
||||||
|
getAgences():void { |
||||||
|
this.agenceService.getAgences() |
||||||
|
.subscribe(agences => this.agences = agences); |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,17 +1,20 @@ |
|||||||
<div class = mb-3> |
<div class="row mb-4"> |
||||||
<table> |
|
||||||
<tr> |
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-3"> |
||||||
<th>Name</th> |
<label for="businessunit-name" class="form-label">Nom</label> |
||||||
</tr> |
<input class="form-control" id="businessunit-name" [(ngModel)]="businessunit.name" placeholder="Nom"> |
||||||
<tr> |
</div> |
||||||
<td> |
|
||||||
<input id="businessunit-name" [(ngModel)]="businessunit.name" placeholder="name"> |
</div> |
||||||
</td> |
|
||||||
</tr> |
<div class="row mb-5"> |
||||||
</table> |
|
||||||
|
<div class="form-group col-12 col-md-6"> |
||||||
|
<label class="form-label">Agence</label> |
||||||
|
<select class="form-select" name="agence" id="agence-select" [(ngModel)]="businessunit.agenceId"> |
||||||
|
<option value="" disabled selected>Choisissez l'agence de cette business Unit</option> |
||||||
|
<option *ngFor="let agence of agences" [ngValue]="agence.id">{{agence.name}}</option> |
||||||
|
</select> |
||||||
|
</div> |
||||||
|
|
||||||
<select name="agence" id="agence-select" [(ngModel)]="businessunit.agenceId"> |
|
||||||
<option value="">-- Choisissez l'agence de cette business Unit --</option> |
|
||||||
<option *ngFor="let agence of agences" [ngValue]="agence.id">{{agence.name}}</option> |
|
||||||
</select> |
|
||||||
</div> |
</div> |
||||||
|
Loading…
Reference in new issue