title: How to display datepicker on button click in angular?
body: <p>I want the <strong>datepicker</strong> to be displayed on click of button and when I select the date it should display in textbox using angular.Pls help me solve this as on button click no <strong>datepicker</strong> is opened</p>
  <pre><code>&lt;button type=&quot;button&quot; class=&quot;btn btn-icon waves-effect waves-light btn-success&quot; 
                          click=&quot;getReport()&quot;&gt;
                    &lt;i class=&quot;fas fa-info-circle&quot;&gt;&lt;/i&gt;
  &lt;/button&gt;
              
  &lt;mat-form-field&gt;
      &lt;input matInput type=&quot;text&quot; class=&quot;form-content&quot; id=&quot;pickDate&quot; placeholder=&quot;Date&quot; 
             [(ngModel)]=&quot;selectedFromDate&quot; bsDatepicker [ngModelOptions]=&quot;{standalone: true}&quot;
             [bsConfig]=&quot;{ isAnimated: true,adaptivePosition: true,containerClass:'theme-red',dateInputFormat: 'MM/DD/YYYY', selectFromOtherMonth: 'true'}&quot;
             (ngModelChange)=&quot;setFromDate($event)&quot; required autocomplete=&quot;off&quot;&gt;                 
    &lt;/mat-form-field&gt; 
  </code></pre>
  <p>Function Call:</p>
  <pre><code>async getReport() {
      $(&quot;.btn-success&quot;).datepicker('show');
    }
  </code></pre>