Skip to content

Instantly share code, notes, and snippets.

@sawyerbutton
Last active September 28, 2018 02:21
Show Gist options
  • Select an option

  • Save sawyerbutton/8ee3d19a22dedc3ea936147ca5240e64 to your computer and use it in GitHub Desktop.

Select an option

Save sawyerbutton/8ee3d19a22dedc3ea936147ca5240e64 to your computer and use it in GitHub Desktop.
this.applicationService.getApplicationTableData().subscribe(data => {
const tempList = [];
data.forEach((item, index) => {
const countLink = item.applicationCount;
this.applicationService.getApplicationCountData(countLink).subscribe(count => {
tempList.push({
key: (index + 1).toString(),
linkUrl: item.linkUrl,
applicationName: item.applicationName,
// applicationCount: item.applicationCount,
applicationCount: count,
model: item.model,
type: item.type,
});
if (index === data.length - 1) {
this.applicationTableData = tempList;
this.loadingForTable = true;
this.loading = false;
}
});
});
let tempList = [];
data.forEach((item, index) => {
const countLink = item.linkUrl;
// this.applicationService.getApplicationCountData(countLink).subscribe(count => {
// tempList.push({
// key: (index + 1).toString(),
// linkUrl: item.linkUrl,
// applicationName: item.applicationName,
// // applicationCount: item.applicationCount,
// applicationCount: count,
// model: item.model,
// type: item.type,
// });
// if (index === data.length - 1) {
// this.applicationTableData = tempList;
// this.loading = false;
// }
// });
tempList.push({
key: (index + 1).toString(),
linkUrl: item.linkUrl,
applicationName: item.applicationName,
// applicationCount: item.applicationCount,
applicationCount: item.applicationCount,
model: item.model,
type: item.type,
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment