如何重置" my-date-picker"点击Angular2 +中的点击重置按钮?

时间:2018-03-26 14:24:32

标签: javascript angular angular2-forms

我的HTML代码

     <form #myForm="ngForm" novalidate>
       <my-date-picker placeholder="Start Date" [options]="myDatePickerInlineOptions" [(ngModel)]="gender2" (dateChanged)="Filter_Post_Date($event, 0)" [selDate]="selectedDateInline" [locale]="locale"></my-date-picker>
       <my-date-picker placeholder="End Date" [options]="myDatePickerInlineOptions" [(ngModel)]="gender2" (dateChanged)="Filter_Post_Date($event, 1)" [selDate]="selectedDateInline" [locale]="locale"></my-date-picker>
     </form>

我的重置按钮HTML

<div class="btn btn-primary btn-reset" (click)="reset_filter()">Reset</div>

1 个答案:

答案 0 :(得分:0)

reset_filter(){
  this.gender2 = null;
}