如何清除HTML表单中的新“添加”按钮?

时间:2019-04-17 13:32:02

标签: angular

我有一个edit-component.html,就在这里。

我有一个“新记录”按钮,当我单击它时,它应该清除这些字段,以便我可以键入新数据并将其添加到数据库中。我可以在同一个html文件中执行此操作,还是应该打开一个新的newRecord-component.html?

<ng-container *ngIf="firm">
  <p>
    ID : {{firm.id}}
  </p>
  <p>Durum : <app-status-template status='{{firm.status}}'></app-status-template>
    <p-inputSwitch (onChange)="handleChange($event)" [(ngModel)]="checked"></p-inputSwitch> 
  </p>

  <p>
    Name: <input pInputText type="text"  [(ngModel)]="firm.name">
  </p>
</ng-container>

0 个答案:

没有答案