Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open ngbDatepicker on click of input

I want to open bootstrap 4 date picker on the click of input field. i don't want to display calender icon How can I resolve this issue?

like image 721
Richa Shah Avatar asked Feb 22 '18 09:02

Richa Shah


Video Answer


1 Answers

You can do something like this:

<input
  readonly
  placeholder="yyyy-mm-dd"
  class="form-control"
  ngbDatepicker 
  (click)="datePicker.toggle()"
  #datePicker="ngbDatepicker">

I created a small demo example here: https://stackblitz.com/edit/angular-anhgsg

like image 118
SplitterAlex Avatar answered Sep 28 '22 00:09

SplitterAlex