OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Bind saved Date in Edit Form using Angular 17

  • Thread starter Thread starter Elaine Byene
  • Start date Start date
E

Elaine Byene

Guest
I have a form where the date is entered and saved but the date is not binded when I go to edit the form.

JSON:

Code:
"checkOut": {
    "runDate": "2024-07-05T09:42:00.000Z",
}

The form is:

Code:
<input type="datetime-local" [(ngModel)]="checkOut.runDate">

Date is shown by binding like this:

Code:
{{source.room.checkOut?.runDate | date:"dd MMM, yyyy"}}

When I go to edit the form, I want the input field [(ngModel)]="checkOut.runDate" to be pre-filled if the date is already entered. How can I achieve this?

<p>I have a form where the date is entered and saved but the date is not binded when I go to edit the form.</p>
<p>JSON:</p>
<pre><code>"checkOut": {
"runDate": "2024-07-05T09:42:00.000Z",
}
</code></pre>
<p>The form is:</p>
<pre><code><input type="datetime-local" [(ngModel)]="checkOut.runDate">
</code></pre>
<p>Date is shown by binding like this:</p>
<pre><code>{{source.room.checkOut?.runDate | date:"dd MMM, yyyy"}}
</code></pre>
<p>When I go to edit the form, I want the input field <code>[(ngModel)]="checkOut.runDate"</code> to be pre-filled if the date is already entered. How can I achieve this?</p>
 

Latest posts

I
Replies
0
Views
1
impact christian
I
Top