|
|
@ -14,7 +14,7 @@ export class AgenceComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor( |
|
|
|
private http : HttpClient, |
|
|
|
private http : HttpClient, |
|
|
|
private agenceservice: AgenceService, |
|
|
|
private agenceService: AgenceService, |
|
|
|
) { } |
|
|
|
) { } |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
@ -22,12 +22,12 @@ export class AgenceComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getAgences():void { |
|
|
|
getAgences():void { |
|
|
|
this.agenceservice.getAgences() |
|
|
|
this.agenceService.getAgences() |
|
|
|
.subscribe(agences => this.agences = agences); |
|
|
|
.subscribe(agences => this.agences = agences); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
add(agence: Agence): void { |
|
|
|
add(agence: Agence): void { |
|
|
|
this.agenceservice.addAgence(agence) |
|
|
|
this.agenceService.addAgence(agence) |
|
|
|
.subscribe(agence => { |
|
|
|
.subscribe(agence => { |
|
|
|
this.agences.push(agence); |
|
|
|
this.agences.push(agence); |
|
|
|
}); |
|
|
|
}); |
|
|
|