BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
constructor(private dataService: DataService) {
this.dataService.getDataFromAPI().subscribe(response => {
console.log(response);
var temp = Object.values(response);
var arr = [];
for (var i = 0; i < temp.length; i++) {
var stringifiedData = JSON.stringify(temp[i]).replace("title", "type");
var addId = JSON.parse(stringifiedData);
// adds id for parent record
addId.id = i + 1;
// adds id for child record
for (var j = 0; j < addId.crime_types.length; j++) {
addId.crime_types[j].id = addId.id + j + 1;
}
arr.push(addId);
}
this.data = arr;
this.tree.fields.dataSource = this.data;
});
} |