Hai Team,
I have writtten reset function for all input values in the Angular 4 Typescript project.But the date values are not clearing after clicking the reset button.Please give me a solution to clear the date fields ASAP.
We are expecting a quick solution from your side.
Herewith I attach the Html code and Typescript code below.
HTML Code:
Input Field
<input type="text" [(ngModel)]='safetyenvinstance.incidentDatetime' name="incidentdatetime" id="incidentDateTime" ej-datetimepicker width='200px' #nameIncidentDateTime="ngModel" required autocomplete="off">
Button
<button class="btn btn-danger btn-space pull-right" style="margin-left:5px;width:100px;" (click)="reset()">Cancel</button>
Typescript Code:
reset() {
debugger;
this.safetyenvinstance = new SheSafetyEnvIncidentModal();
this.businesslocationfieldsvalues = 0;
this.safetytypefieldsvalues = 0;
this.valuestreamfieldsvalues = 0;
this.safetyenvinstance.IncidentDateTime = new Date;
this.safetyenvinstance.ReportedDateTime = new Date;
}
Regards,
Sridhar