I am working on an application that is written in ASP.NET WebAPI and Angular. Everything is working great except for the JSON dates that I'm getting from WebAPI which look like /Date(1402034400000)/
. Angular doesn't know what to do with this string. If I parse it down to just the numbers then it converts it to a date when I use date: 'MM/dd/yyyy'
.
How do I go about fixing this in the angular way? Maybe a directive?
In this view the person.trainingDate
looks like /Date(1402034400000)/
in the rendered HTML. Even if I add | date: 'MM/dd/yyyy'
it displays the same because angular doesn't recognize the string as a parsable date.
<table class="table table-bordered table-hover">
<thead><tr><th>Training Date</th></tr></thead>
<tbody>
<tr ng-repeat="person in company.people">
<td>{{person.trainingDate}}</td>
</tr>
</tbody>
</table>
Thank you,
Aaron