Partial Code
.controller('HomeCtrl', ['$scope', '$stateParams', 'lastactivities',
function($scope, $stateParams, lastactivities) {
var mytoken = sessionStorage.getItem('token');
lastactivities.send(mytoken).then(function(activities) {
var activitytab = activities.data;
$scope.datab = activities.data;
});
}
])
<ul ng-repeat="item in datab">
<li ng-repeat="value in item.date track by $index">{{value}}</li>
</ul>
JSON
{
"erreur": "",
"data": [{
"date": "2016-03-04",
"activities": [{
"type": "bank",
"icon": {
"type": "lock-3",
"color": "#000000"
},
"badge": {
"text": "",
"color": "#000000",
"backgroundColor": "transparent"
},
"action": null,
"title": "MOT DE PASSE MODIFIÉ",
"description": ""
}, {
"type": "client",
"icon": {
"type": "document-1",
"color": "#000000"
},
"badge": {
"text": "1 400 €",
"color": "#ffffff",
"backgroundColor": "#97d42e"
},
"action": "925",
"title": "FACTURE",
"description": "nike - appli mobile"
}, {
"type": "client",
"icon": {
"type": "user-1",
"color": "#000000"
},
"badge": {
"text": "",
"color": "#000000",
"backgroundColor": "transparent"
},
"action": 925,
"title": "NOUVEAU CLIENT",
"description": "nike"
}]
}, {
"date": "2016-03-03",
"activities": [{
"type": "bank",
"icon": {
"type": "lock-3",
"color": "#000000"
},
"badge": {
"text": "",
"color": "#000000",
"backgroundColor": "transparent"
},
"action": null,
"title": "MOT DE PASSE MODIFIÉ",
"description": ""
}, {
"type": "client",
"icon": {
"type": "document-1",
"color": "#000000"
},
"badge": {
"text": "643,44 €",
"color": "#ffffff",
"backgroundColor": "#f84c74"
},
"action": "719",
"title": "FACTURE EN RETARD",
"description": "Justine - Facture 2"
}, {
"type": "client",
"icon": {
"type": "document-1",
"color": "#000000"
},
"badge": {
"text": "400 €",
"color": "#ffffff",
"backgroundColor": "#f84c74"
},
"action": "719",
"title": "FACTURE EN RETARD",
"description": "Justine - Ma first facture"
}]
}, {
"date": "2016-02-18",
"activities": [{
"type": "bank",
"icon": {
"type": "lock-3",
"color": "#000000"
},
"badge": {
"text": "",
"color": "#000000",
"backgroundColor": "transparent"
},
"action": null,
"title": "MOT DE PASSE MODIFIÉ",
"description": ""
}]
}, {
"date": "2016-02-08",
"activities": [{
"type": "bank",
"icon": {
"type": "lock-3",
"color": "#000000"
},
"badge": {
"text": "",
"color": "#000000",
"backgroundColor": "transparent"
},
"action": null,
"title": "MOT DE PASSE MODIFIÉ",
"description": ""
}]
}, {
"date": "2016-02-02",
"activities": [{
"type": "client",
"icon": {
"type": "document-1",
"color": "#000000"
},
"badge": {
"text": "0 €",
"color": "#ffffff",
"backgroundColor": "#97d42e"
},
"action": "724",
"title": "FACTURE",
"description": "Test client - F - 00005"
}, {
"type": "client",
"icon": {
"type": "document-1",
"color": "#000000"
},
"badge": {
"text": "0 €",
"color": "#ffffff",
"backgroundColor": "#97d42e"
},
"action": "720",
"title": "FACTURE",
"description": "Abus - F - 00004"
}]
}, {
"date": "2016-02-01",
"activities": [{
"type": "client",
"icon": {
"type": "user-1",
"color": "#000000"
},
"badge": {
"text": "",
"color": "#000000",
"backgroundColor": "transparent"
},
"action": 724,
"title": "NOUVEAU CLIENT",
"description": "Test client - Scooby"
}, {
"type": "client",
"icon": {
"type": "document-1",
"color": "#000000"
},
"badge": {
"text": "1 500 €",
"color": "#ffffff",
"backgroundColor": "#97d42e"
},
"action": "720",
"title": "FACTURE",
"description": "Abus - Fact"
}, {
"type": "client",
"icon": {
"type": "user-1",
"color": "#000000"
},
"badge": {
"text": "",
"color": "#000000",
"backgroundColor": "transparent"
},
"action": 720,
"title": "NOUVEAU CLIENT",
"description": "Abus - Busbus"
}, {
"type": "document",
"icon": {
"type": "download-6",
"color": "#000000"
},
"badge": {
"text": "",
"color": "#000000",
"backgroundColor": "transparent"
},
"action": null,
"title": "7 DOCUMENTS DÉPOSÉS",
"description": "retrait-par-carte-Invalid date.jpg, Document-01-02-2016.jpg, Doss1, Doss2, Document-01-02-2016.jpg, -Invalid date.jpg, retrait-par-carte-01-02-2016.jpg"
}, {
"type": "client",
"icon": {
"type": "document-1",
"color": "#000000"
},
"badge": {
"text": "643,44 €",
"color": "#ffffff",
"backgroundColor": "#97d42e"
},
"action": "719",
"title": "FACTURE",
"description": "Justine - Facture 2"
}, {
"type": "bank",
"icon": {
"type": "lock-3",
"color": "#000000"
},
"badge": {
"text": "",
"color": "#000000",
"backgroundColor": "transparent"
},
"action": null,
"title": "MOT DE PASSE MODIFIÉ",
"description": ""
}, {
"type": "client",
"icon": {
"type": "document-1",
"color": "#000000"
},
"badge": {
"text": "400 €",
"color": "#ffffff",
"backgroundColor": "#97d42e"
},
"action": "719",
"title": "FACTURE",
"description": "Justine - Ma first facture"
}, {
"type": "client",
"icon": {
"type": "user-1",
"color": "#000000"
},
"badge": {
"text": "",
"color": "#000000",
"backgroundColor": "transparent"
},
"action": 719,
"title": "NOUVEAU CLIENT",
"description": "Justine - Arma"
}, {
"type": "bank",
"icon": {
"type": "flag-1",
"color": "#000000"
},
"badge": {
"text": "",
"color": "#000000",
"backgroundColor": "transparent"
},
"action": null,
"title": "BIENVENUE À BORD DE TIIME AE",
"description": "C'est parti pour 30 jours offerts"
}]
}]
}
I'm new in AngularJS
and trying to display only the date
and the type
but no luck yet.
Any help would be appreciated!
<ul ng-repeat="item in datab">
and then<li>{{item.date}}</li>
– ddepablo Mar 7 at 10:23