Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component, OnInit} from '@angular/core';
  2. import { ClientService } from '../../../../../service/client.service';
  3. import { Client } from '../../../../entities/Client';
  4. import { Router } from '@angular/router';
  5. import { FormGroup, FormControl } from '@angular/forms';
  6.  
  7. @Component({
  8.   selector: 'app-client',
  9.   templateUrl: './client.component.html',
  10.   styleUrls: ['./client.component.css']
  11. })
  12. export class ClientComponent implements OnInit {
  13.  
  14.  
  15.   clients :Client[];
  16.   public idCourant :any;
  17.   public cl :Client;
  18.   public form:FormGroup;
  19.   constructor(private clientService:ClientService,private router: Router) { }
  20.  
  21.   ngOnInit() {
  22.     this.clientService.getClient().map(resp=>resp.json())
  23.     .subscribe(
  24.       clients=>{
  25.               this.clients=clients;
  26.       },error=>{
  27.               console.log("Erreur !"+error);
  28.           }
  29.       );
  30.      ;
  31.   }
  32.  
  33.   onRefrech($event){
  34.       this.ngOnInit();      
  35.     }
  36.   affecatationIdClient(id){
  37.      this.idCourant=id;
  38.   }
  39.   affecatationClient(c:Client){
  40.     this.cl=c;
  41.  
  42.  }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement