I have a problem about retrieving some disabled dates in angular Datepicker,
when i am hard coding the dates i do not have problem, everything is working fine,
but when i retrieve the disabled dates from my web api backend, the disabled date are ignored ...
I'm still a noob in programming, i am probably missing something stupid
Is it something about async programming or observable variables ?
component.html
<input type="text" placeholder="Daterangepicker" class="form-control" bsDaterangepicker
[datesDisabled]="disabledDates">
component.ts
export class Component implements OnInit {
disabledDates :Date[];
constructor(...) { }
ngOnInit() {
...
this.getUnavaibilities();
}
getUnavaibilities(){
this.homesService.getUnavaibilities(this.Id).subscribe(
reponse => this.UnavailabilitieshandleSuccesfulResponse(reponse));
}
UnavailabilitieshandleSuccesfulResponse(reponse){
this.disabledDates = reponse;
console.log(this.disabledDates) // this working fine !
//output from console.log
// Array(4) [ "2019-09-27T00:00:00", "2019-09-28T00:00:00", "2019-09-
//29T00:00:00", "2019-09-30T00:00:00" ]
}
}