angular 4, md2-datepicker reset value

Discussão em 'Angular' iniciado por Ihor Lavs, Novembro 8, 2024.

  1. Ihor Lavs

    Ihor Lavs Guest

    I use md2-datepicker with reactive form in my webApp, but I need to reset the selected value.

    Do anybody know how I can to do it?

    I tried to do something like this, but it didn't work for me. The last selected value dosn't reset.

    handleDayClick(request: any) {
    this.request = new BookingRequest();
    this.request.checkIn = request.date.format();
    this.requestForm.setValue(this.request);
    this.openDialog();
    }


    also I have a model for my form:

    export class BookingRequest {
    id?: number;
    comment: string = '';
    checkIn: string = null;
    checkOut: string = null;
    approved: boolean = false;
    }

    Continue reading...

Compartilhe esta Página