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;
constructor(private calendar: NgbCalendar) {
// set date picker default selected date
this.model = {year:2015,month:7,day:14};
}
}
app.component.html
<h4 style="padding-top:25px; padding-bottom:25px;">
Angular Bootstrap - Datepicker default visible year month
</h4>
<h5><b>Selected Date:</b></h5>
<h5>{{ model | json}}</h5>
<br/>
<ngb-datepicker
#datePicker
[(ngModel)]="model"
[startDate]="{year:2015,month:7}">
</ngb-datepicker>
- angular bootstrap - How to use Datepicker
- angular bootstrap - Select today from Datepicker
- angular bootstrap - Datepicker navigate & select today
- angular bootstrap - Datepicker navigate event
- angular bootstrap - Datepicker default selected date
- angular bootstrap - How to show Datepicker in a popup
- angular bootstrap - How to use Accordion
- angular bootstrap - Open an Accordion panel at a time
- angular bootstrap - Toggle Accordion panel on button click
- angular bootstrap - Select Nav tab on button click
- angular bootstrap - Prevent selecting a tab in Nav
- angular bootstrap - How to enable disable tab in Nav
- angular material - How to use Button toggle
- angular material - How to use Button toggle group
- angular material - Button toggle group multiple selection