How can I convert a JSON date /Date(1454351400000)/ into a proper date format using AngularJS and ASP.NET?
$http.get('/home/GetProducts')
.success(function (result) {
$scope.products = result;
})
.error(function (data) {
console.log(data);
});
index.cshtml file
<html>
<head>
<title>Product with Date</title>
<script src="~/Scripts/angular.min.js"></script>
<script src="~/Scripts/App.js"></script>
</head>
<body ng-app="myApp">
<h3>Products</h3>
<div ng-controller="mainController" >
<table class="table table-striped">
<tr ng-repeat="product in products">
<td>{{product.ProductName}}</td>
<td>{{product.CreatedDate | date:"h:mma 'on' MMM d,y"}}</td>
<td class="text-right">
<button class="btn btn-danger" ng-click="deleteProduct(product)">X</button>
</td>
</tr>
</table>
<input type="text" required ng-model="newProduct" />
<a href="#" class="btn btn-primary" ng-click="addProduct()">Add Product</a>
</div>
</body>
</html>