app.component.ts
import { Component } from '@angular/core';
import {
NgbCalendar, NgbDatepicker, NgbDateStruct
} from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
//model:NgbDateStruct;
model:any
today:Date = new Date();
date:{year:number,month:number} = {
year: this.today.getFullYear(),
month: this.today.getMonth() + 1
};
constructor(private calendar: NgbCalendar) { }
}
app.component.html
<h4 style="padding-top:25px; padding-bottom:25px;">
Angular Bootstrap - Datepicker navigate event
</h4>
<h5><b>Current Navigation:</b></h5>
<h5>{{'Year '+ date.year + ' : Month ' + date.month}}</h5>
<br/>
<ngb-datepicker
#datePicker
[(ngModel)]="model"
(navigate)="date=$event.next">
</ngb-datepicker>
- angular bootstrap - Datepicker navigate & select today
- angular bootstrap - Datepicker default selected date
- angular bootstrap - Datepicker default visible year month
- angular bootstrap - How to show Datepicker in a popup
- angular material - How to change Slider width
- angular material - How to show thumb label in Slider
- angular material - How to use Slider input event
- angular material - How to use custom Badge size
- angular material - How to show Badge in a button
- angular material - How to disable a panel in Accordion
- angular material - Show Accordion toggle icon on left
- angular material - Determine an Expansion Panel is opened or closed
- angular material - Expansion Panel expandedChange event
- angular material - Accordion expanded panels header background color
- angular material - How to use Navigation List