title: How to display a date in <input type = "date"> field when using Angular
body: <p>I want to get some inputs values from the user by using a form and save it in the database. Then I want to display the saved data using this same form. But even though I get the values from these input fields I can not display the retrieved values here;</p>
  
  <pre><code>&lt;input type="date" name="ArrivalDate" #ArrivalDate="ngModel" [(ngModel)]="service.formData.ArrivalDate" class="form-control"&gt;
  </code></pre>
  
  <p>And</p>
  
  <pre><code>&lt;input type="date" name="DepartureDate" #DepartureDate="ngModel" [(ngModel)]="service.formData.DepartureDate" class="form-control"&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/lVFRu.jpg" rel="nofollow noreferrer">Screenshot: Display retrieved data from the database but date fields are not filled with the necessary data</a></p>
  
  <p>/<em>----- code segment -----</em>/</p>
  
  <pre><code>&lt;div class="form-row"&gt;
              &lt;div class="form-group col-md-4"&gt;
                &lt;div class="form-group"&gt;
                    &lt;label&gt;Arrival Date&lt;/label&gt;
                    &lt;!--I want to get the date input from the user--&gt;
                    &lt;!--I want to display the date input which given by the user--&gt;
                    &lt;input type="date" name="ArrivalDate" #ArrivalDate="ngModel" [(ngModel)]="service.formData.ArrivalDate" class="form-control"&gt;
                    &lt;div class="validation-error" *ngIf="ArrivalDate.invalid &amp;&amp; ArrivalDate.touched"&gt;This field is required.&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group col-md-4"&gt;
                &lt;div class="form-group"&gt;
                    &lt;label&gt;Departure Date&lt;/label&gt;
                     &lt;!--I want to get the date input from the user--&gt;
                    &lt;!--I want to display the date input which given by the user--&gt;
                    &lt;input type="date" name="DepartureDate" #DepartureDate="ngModel" [(ngModel)]="service.formData.DepartureDate" class="form-control"&gt;
                    &lt;div class="validation-error" *ngIf="DepartureDate.invalid &amp;&amp; DepartureDate.touched"&gt;This field is required.&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group col-md-4"&gt;
                  &lt;div class="form-group"&gt;
                    &lt;label&gt;Star Category&lt;/label&gt;
                    &lt;input name="StarCategory" #StarCategory="ngModel" [(ngModel)]="service.formData.StarCategory" class="form-control"&gt;
                    &lt;div class="validation-error" *ngIf="StarCategory.invalid &amp;&amp; StarCategory.touched"&gt;This field is required.&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>