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;
constructor(private calendar: NgbCalendar) {}
}
app.component.html
<h4 style="padding-top:25px; padding-bottom:25px;">
Angular Bootstrap - How to show Datepicker in a popup
</h4>
<h5><b>Selected Date:</b></h5>
<h5>{{ model | json}}</h5>
<br/>
<form class="row row-cols-sm-auto">
<div class="col-12">
<div class="input-group">
<input
ngbDatepicker
#datePicker ="ngbDatepicker"
class="form-control"
placeholder="yyyy-mm-dd"
name="datePicker"
[(ngModel)]="model">
<button (click)="datePicker.toggle()">
Open
</button>
</div>
</div>
</form>
- angular bootstrap - How to use Progressbar
- angular bootstrap - Show text inside Progressbar
- angular bootstrap - Progressbar maximum value
- angular bootstrap - Show custom label in Progressbar
- angular bootstrap - How to change Progressbar height
- angular bootstrap - Popover with HTML content
- angular bootstrap - How to delay Popover open close
- angular bootstrap - How to use Timepicker
- angular bootstrap - Timepicker with second
- 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 - Datepicker default visible year month