如何从另一个表更新一个表中的值

时间:2019-05-22 12:04:28

标签: angular7

我是angular的初学者,我尝试开发一个应用程序,实际上,我有一个表格可以创建一个默认状态为已注册状态的新发票,在我想移至同一张发票的付款之后,状态帐单通常会更改!我有一个问题如何在表部分中添加值并在表bil中更新 我不知道该怎么办,我真的很想谢谢你

bill.component.html

<div class="form-group">
    <label for="statut">Statut Facture </label>
    <input type="text" class="form-control" 
     id="statut" required [(ngModel)]="facture.statut"
     name="statut" [value]="facture.statut" disabled >   
</div>

bill.component.ts

  ngOnInit() {
      this.facture.statut = "Enregistré"
  }

  save() {
      this.factureService.CreateFacture(this.facture)
              .subscribe(data => console.log(data), error => 
                 console.log(error));
                 this.facture = new Facture();
      }

  onSubmit() {
      this.submitted = true;
      this.save();
  }

0 个答案:

没有答案