-
Notifications
You must be signed in to change notification settings - Fork 0
/
myposts.js
27 lines (23 loc) · 902 Bytes
/
myposts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
angular.module('app')
.controller('MyPostsCtrl', function ($scope, $auth,$timeout, BidService, NgTableParams,$location) {
BidService.getMyPosts().then(function(data) {
// params.total(data); // recal. page nav controls
$scope.dataSet = data.data;
$timeout(function(){
$scope.tableParams = new NgTableParams({
// initial sort order
sorting: { createdAt: "desc" }
}, {
dataset: $scope.dataSet
});
});
var a=data.data;
// console.log(data.data);
});
$scope.convert= function(date){
return moment(date).format('MMMM Do YYYY, h:mm:ss a');
};
$scope.view= function(data){
$location.path('/user/bid/'+data._id);
}
});