I am using the datepicker from this source: https://ng-bootstrap.github.io/#/components/datepicker/api
And I would like to check if the ngb-datepicker is closed because I need to change the text of the button where it is triggered.
template:
<button (click)="dp.open(); changeText();">{{buttonText}}</button>
<ngb-datepicker #dp
[(ngModel)]="model"
(onHidden)="changeButtonText2()" <<---is this possible? >
/>
ts:
import {Component} from '@angular/core';
import {NgbCalendar} from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'ngbd-datepicker-basic',
templateUrl: './datepicker-basic.html'
})
export class NgbdDatepickerBasic {
buttonText: string = 'Open Calendar'
constructor(private calendar: NgbCalendar) {
}
changeText() {
this.buttonText = 'The Calendar is Open';
}
changeButtonText2() {
this.buttonText = 'Open Calendar'
}
}
The ngx-bootstrap datepick have this but it seems the ngb-datepicker does not implement this feature. Can someone help me create a workaround so I don't have to use the ngx-bootstrap just for this? I already added some styling so...
Thanks :)