I have an issue with getting date from json and integrate it with <input> tag.
I have a json object that has the 'date' value like this - dd/mm/yyyy and it doesn't show me that date in the html, and when I press on the 'Edit' button it doesn't receive this date.
JSON
{
"books":[
{
"title": "Harry Potter and the Philosopher's Stone",
"author": "J. K. Rowling",
"date": "26/06/1997"
}
]
}
<tr ng-repeat="book in recivedBooks">
<td>
<span class="date" ng-hide="editMode">Realease Date: {{book.date}}</span>
<input class="form-control input-lg" name="date" type="date" placeholder="dd/mm/yyyy" ng-show="editMode" ng-model="book.date" required>
</td>
</tr>
Is there a way to parse the date from the json, show it in the html and then when you press on the 'Edit' button it will automatically will go to the <input> ?
{{book.date | date}}. Further reference here: docs.angularjs.org/api/ng/filter/date