|
|
|
@ -1,5 +1,7 @@ |
|
|
|
|
import {Component, Input, OnInit} from '@angular/core'; |
|
|
|
|
import {Collaborateur} from "../../../interfaces/collaborateur"; |
|
|
|
|
import {HttpClient} from "@angular/common/http"; |
|
|
|
|
import {CollaborateurService} from "../../../services/collaborateur.service"; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-collaborateur-detail', |
|
|
|
@ -8,12 +10,24 @@ import {Collaborateur} from "../../../interfaces/collaborateur"; |
|
|
|
|
}) |
|
|
|
|
export class CollaborateurDetailComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
collaborateurs : Collaborateur[] = []; |
|
|
|
|
|
|
|
|
|
@Input() |
|
|
|
|
collaborateur: Collaborateur | undefined; |
|
|
|
|
collaborateur = {} as Collaborateur ; |
|
|
|
|
|
|
|
|
|
constructor() { } |
|
|
|
|
constructor( |
|
|
|
|
private http : HttpClient, |
|
|
|
|
private collaborateurService: CollaborateurService, |
|
|
|
|
) { } |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.getCollaborateurs(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getCollaborateurs():void { |
|
|
|
|
this.collaborateurService.getCollaborateurs() |
|
|
|
|
.subscribe(collaborateurs => this.collaborateurs = collaborateurs); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|