Guest User

Untitled

a guest
Apr 26th, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { NgModule,Component, OnInit, Input } from '@angular/core';
  2. import { Client } from '../../../../../entities/Client';
  3. import { ClientService } from '../../../../../../service/client.service';
  4. import {FormGroup,FormControl} from '@angular/forms';
  5.  
  6. @Component({
  7.   selector: 'app-modifier',
  8.   templateUrl: './modifier.component.html',
  9.   styleUrls: ['./modifier.component.css']
  10. })
  11. export class ModifierComponent implements OnInit {
  12.  
  13.    form:FormGroup;
  14.  
  15.   @Input() client:Client;
  16.    nomAA:string;
  17.   constructor(private serviceClient:ClientService) {
  18.  
  19.   }
  20.  
  21.   ngOnInit() {
  22.  this.form=new FormGroup({
  23.      nom:new FormControl(this.client.nom),
  24.     prenom:new FormControl(this.client.prenom),
  25.      adresse:new FormControl(this.client.adresse),
  26.      ville:new FormControl(this.client.ville),
  27.      numTel:new FormControl(this.client.numTel),
  28.      profession:new FormControl(this.client.profession),
  29.      email:new FormControl(this.client.email),
  30.  });
  31.  
  32.   }
  33.  
  34.   //  getClient(){
  35.   //   this.serviceClient.getClientById(this.c).subscribe(
  36.   //     data=>{
  37.   //       this.client=data;
  38.   //       console.log(this.client);
  39.   //     }
  40.   //   );
  41.   //  }
  42.    public modifierClient(){
  43.      console.log(this.client);
  44.     //   this.client=client;
  45.       //  this.serviceClient.modifierClient(this.client.idClient,this.client).subscribe(
  46.  
  47.    // );
  48.  
  49.    }
  50. }
Add Comment
Please, Sign In to add comment