angularangular8angular9ng-bootstrapangular11

Detect Change in Select in Angular


I have some difficulties logging the year when you select the year. I managed to hide the month and dates already though.

STACKBLITZ

Simple datepicker

<ngb-datepicker
  [(ngModel)]="model"
  (dateSelect)="onDateChange($event)"
></ngb-datepicker>

Solution

  • I hope my answer will help you. Use (navigate)="navigateEvent($event)" instead.

    navigateEvent(event) {
        console.log(event.next.year);
      }