I have this type of json object:
[
{
"contactsCount": 2,
"id": 1,
"userKey": "$2a$10$3jCL8.rJV9/KS11MtrB4r.0uE4Fu/rGwEk.ko0HTkzFNiKXhh1.X.",
"groupname": "Angular",
"createdAt": "2018-01-15T07:21:42.000Z",
"updatedAt": "2018-01-15T07:21:42.000Z",
"contactgroups": [
{
"id": 1,
"contact": {
"id": 1,
"gsm": "111111111",
"firstname": "Mohamed",
"lastname": "Sameer"
}
},
{
"id": 3,
"contact": {
"id": 3,
"gsm": "222222222",
"firstname": "Rizwan",
"lastname": "Riz"
}
}
]
}
]
I am getting this in $scope.modalData.
I have to show my gsm, first name and last name in table:
My jade code:
table.table
tr
th GSM
th First Name
th Last Name
tr(ng-repeat='testData in modalData.contactgroups[0]')
td {{testData.gsm}}
td {{testData.firstname}}
td {{testData.lastname}}
anyone help me, i am not getting data, can anyone explain me how to do that?
I am getting this response when user click edit button from another table:
$scope.modalData = {};
$scope.setModal = function (data) {
$scope.modalData = data;
console.log($scope.modalData);
}
Jade:
td
a(data-toggle='modal',ng-click='setModal(groups[$index])' ) Groups
contactobject i.e.testData in modalData.contactgroups[0].contact