I'am coding with angular 7 and bootstrap 4. I used bootstrap datepicker to select date and trying to get data from it .
My html code is like that :
<div class="col-lg-8 form-group">
<input id="startDate" type="text" placeholder="From"
class="form-control" bsDatepicker
[bsConfig]="{ adaptivePosition: true,
dateInputFormat:'YYYY-MM-DD'}" (change)="onDateSelect($event)" >
</div>
and the JavaScript function is:
selectedStartDate: string;
onDateSelect(event) {
this.selectedStartDate = event.target.value;
console.log(this.selectedStartDate)
}
I'm getting "undefined" as a result.
selectedStartDate = undefined
can anyone help me to get the value of the selected date from the bootstrap datepicker ?