Hi,
I’ve a web service that returns this json:
{
"Response": "Success",
"Message": "Coin list succesfully returned! This api is moving to https://min-api.cryptocompare.com/data/all/coinlist, please change the path.",
"BaseImageUrl": "https://www.cryptocompare.com",
"BaseLinkUrl": "https://www.cryptocompare.com",
"DefaultWatchlist": {
"CoinIs": "1182,7605,5038,24854,3807,3808,202330,5324,5031,20131",
"Sponsored": ""
},
"SponosoredNews": [
{
"id": 907274,
"guid": "https://goo.gl/x2wT5k",
"published_on": 1530020965,
"imageurl": "https://www.cryptocompare.com/media/34077391/onlineio200x200.gif?anchor=center&mode=crop&width=300&height=300&rnd=131744945650000000",
"title": "Online.io - Earn Tokens to Browse The Internet",
"url": "https://goo.gl/x2wT5k",
"source": "CryptoCompare",
"body": "Online.io is implementing a decentralized ecosystem which combines all necessary features for a faster, safer, and more private Internet browsing. Moreover, through the Online.io platform developed by using the most advanced Blockchain technology, both internet end users and website operators will benefit alike.\r\n\r\nThe Online (OIO) token is a unique digital asset that will unleash the Internet from ads, malware and tracking software, leading to a more enjoyable and secure browsing experience, with sizeable benefits for both web operators and end users.",
"tags": "ICO",
"categories": "ICO",
"lang": "EN",
"source_info": {}
}
],
"Data": {
"42": {
"Id": "4321",
"Url": "/coins/42/overview",
"ImageUrl": "/media/12318415/42.png",
"Name": "42",
"Symbol": "42",
"CoinName": "42 Coin",
"FullName": "42 Coin (42)",
"Algorithm": "Scrypt",
"ProofType": "PoW/PoS",
"FullyPremined": "0",
"TotalCoinSupply": "42",
"PreMinedValue": "N/A",
"TotalCoinsFreeFloat": "N/A",
"SortOrder": "34",
"Sponsored": false
},
"300": {
"Id": "749869",
"Url": "/coins/300/overview",
"ImageUrl": "/media/27010595/300.png",
"Name": "300",
"Symbol": "300",
"CoinName": "300 token",
"FullName": "300 token (300)",
"Algorithm": "N/A",
"ProofType": "N/A",
"FullyPremined": "0",
"TotalCoinSupply": "300",
"PreMinedValue": "N/A",
"TotalCoinsFreeFloat": "N/A",
"SortOrder": "2212",
"Sponsored": false
},
......
I have to print the Name and TotalCoinSupply of each Data item?
I’m using this function into a Providers to get the data using HttpClient:
getCoinList() {
return new Promise(resolve => {
this.http.get(this.apiUrlCrypto+'/coinlist',{headers: this.cryptoHeaders}).subscribe(data => {
resolve(data);
}, err => {
console.log(err);
});
});
and this function in a Ionic page to call the provider function:
getCoins(){
console.log('getCoinsList');
this.users = [];
this.coins = [];
this.wsManager.getCoinList()
.then(data => {
this.coins = data;
});
}
I don’t know how to navigate the content of the attribute this.coins and how to
check its content.
cld