parent
f869111002
commit
f32d8872d4
@ -1,20 +0,0 @@ |
||||
<div class="row mb-4"> |
||||
|
||||
<div class="form-group col-12 col-sm-6 col-md-4 col-lg-3"> |
||||
<label for="businessunit-name" class="form-label">Nom</label> |
||||
<input class="form-control" id="businessunit-name" [(ngModel)]="businessunit.name" placeholder="Nom"> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<div class="row mb-5"> |
||||
|
||||
<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> |
||||
|
||||
</div> |
@ -1,42 +0,0 @@ |
||||
import {Component, Input, OnInit} from '@angular/core'; |
||||
import {Businessunit} from "../../../interfaces/businessunit"; |
||||
import {HttpClient} from "@angular/common/http"; |
||||
import {BusinessunitService} from "../../../services/businessunit.service"; |
||||
import {Agence} from "../../../interfaces/agence"; |
||||
import {AgenceService} from "../../../services/agence.service"; |
||||
|
||||
@Component({ |
||||
selector: 'app-businessunit-detail', |
||||
templateUrl: './businessunit-detail.component.html', |
||||
styleUrls: ['./businessunit-detail.component.scss'] |
||||
}) |
||||
export class BusinessunitDetailComponent implements OnInit { |
||||
|
||||
businessunits : Businessunit[] = []; |
||||
@Input() |
||||
businessunit = {} as Businessunit ; |
||||
agences : Agence[] = []; |
||||
agence = {} as Agence ; |
||||
|
||||
constructor( |
||||
private http : HttpClient, |
||||
private businessunitService: BusinessunitService, |
||||
private agenceService: AgenceService, |
||||
) { } |
||||
|
||||
ngOnInit(): void { |
||||
this.getBusinessunits(); |
||||
this.getAgences(); |
||||
} |
||||
|
||||
getBusinessunits():void { |
||||
this.businessunitService.getBusinessunits() |
||||
.subscribe(businessunits => this.businessunits = businessunits); |
||||
} |
||||
|
||||
getAgences():void { |
||||
this.agenceService.getAgences() |
||||
.subscribe(agences => this.agences = agences); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue