How to call '[object Object] in angular *ngFor [closed] - node.js

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
myjson is :
[
{
"support": 2,
"items": [
[
{
"title": "Segitiga Wolfis",
"price": 23000,
"description": "Bahan seratus persen ori, kain kualitas premium. Cocok untuk berpergian acara dan bersantai. Dibuat dengan sepenuh hati dengan prporsisi jahit yang detail dan hasil tampilan yang unik.",
"image": "https://cf.shopee.co.id/file/a98a024dfd6e210773bce8af3e8f604d_tn"
}
]
]
},
{
"support": 1,
"items": [
[
{
"title": "Instan Hijab Triangle",
"price": 25000,
"description": "Bahan Lembut, Cocok untuk berpergian dan bersantai. Instant Hijab Triangle Veil Instant Triangle Lace Veil Amelia Lace Triangle\r\n\r\nColor: Amelia Softpink, Amelia Softpeach, Amelia Navy, Amelia Black\r\nType: instant triangle hijab\r\nMaterial: pollycatton\r\nWeight: 120 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/025c74dc748fb1ebc76e95d7be7f85b2.jpeg"
},
{
"title": "Hijab Quadril Syar'i",
"price": 44000,
"description": "Hijab Quadril Syar'i Diamond Hijab Quadrilateral\r\n\r\nIngredients = Italiano Diamond\r\n\r\nSize = 145 x 145 cm\r\n\r\nEdges = boutique-style sewing edges\r\n\r\nWeight = 210 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/87fcc99a88694bbdcf36841e7671a5cd.jpeg"
}
]
]
},
{
"support": 1,
"items": [
[
{
"title": "Instan Hijab Triangle",
"price": 25000,
"description": "Bahan Lembut, Cocok untuk berpergian dan bersantai. Instant Hijab Triangle Veil Instant Triangle Lace Veil Amelia Lace Triangle\r\n\r\nColor: Amelia Softpink, Amelia Softpeach, Amelia Navy, Amelia Black\r\nType: instant triangle hijab\r\nMaterial: pollycatton\r\nWeight: 120 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/025c74dc748fb1ebc76e95d7be7f85b2.jpeg"
},
{
"title": "Pashmina Ceruti Starp",
"price": 50000,
"description": "Pashmina Ceruty strap Pasmina Babydoll Ceruty hijab pasmina strap\r\nkarakteristik bahan :\r\n- Lentur/jatuh kebawah sehingga mudah dibentuk.\r\n- Tekstur ringan, halus dan lembut. nyaman untuk dipakai sehari hari.\r\n- Tidak mudah kusut.\r\n\r\nMaterial = Babydoll ceruty\r\nSize = 175 x 75 cm\r\nEdge = neat sewing\r\n\r\nWeight = 120 grams\r\n",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/9b7d781d5c2c1bbb73ba7d5615b7677f.jpeg"
},
{
"title": "Satin Square",
"price": 25000,
"description": "Bahan hijab satin sangat baik dan berkualitas. Terlihat mengilap dan lembut, serta ringan saat disentuh. Ketika dikenakan hijab ini nyaman dan tak membuat rasa panas. Untuk kamu yang suka dengan tampilan berbeda, andalkan saja hijab satin ini yang cocok untuk gaya kasual hingga kondangan.",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/b9ec3e70e56c34c97cc578bc2f027fe2.jpeg"
}
]
]
},
{
"support": 1,
"items": [
[
{
"title": "Hijab Quadril Syar'i",
"price": 44000,
"description": "Hijab Quadril Syar'i Diamond Hijab Quadrilateral\r\n\r\nIngredients = Italiano Diamond\r\n\r\nSize = 145 x 145 cm\r\n\r\nEdges = boutique-style sewing edges\r\n\r\nWeight = 210 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/87fcc99a88694bbdcf36841e7671a5cd.jpeg"
}
]
]
},
{
"support": 1,
"items": [
[
{
"title": "Satin Square",
"price": 25000,
"description": "Bahan hijab satin sangat baik dan berkualitas. Terlihat mengilap dan lembut, serta ringan saat disentuh. Ketika dikenakan hijab ini nyaman dan tak membuat rasa panas. Untuk kamu yang suka dengan tampilan berbeda, andalkan saja hijab satin ini yang cocok untuk gaya kasual hingga kondangan.",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/b9ec3e70e56c34c97cc578bc2f027fe2.jpeg"
}
]
]
},
{
"support": 2,
"items": [
[
{
"title": "Hijab Instan Diamond Lova",
"price": 50000,
"description": "Instant Hijab bergo Lova Instant Hijab Diamond Bergo Lova Instant Khimar Veil no ped\r\n\r\nMaterial = Diamond\r\n\r\n- super neat stitching >> other colors are still in the production process\r\n\r\nWeight = 135 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/e5fa1cb23e7ca49052c5a8a81a534b85.jpeg"
}
]
]
},
{
"support": 1,
"items": [
[
{
"title": "Instan Hijab Triangle",
"price": 25000,
"description": "Bahan Lembut, Cocok untuk berpergian dan bersantai. Instant Hijab Triangle Veil Instant Triangle Lace Veil Amelia Lace Triangle\r\n\r\nColor: Amelia Softpink, Amelia Softpeach, Amelia Navy, Amelia Black\r\nType: instant triangle hijab\r\nMaterial: pollycatton\r\nWeight: 120 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/025c74dc748fb1ebc76e95d7be7f85b2.jpeg"
},
{
"title": "Satin Square",
"price": 25000,
"description": "Bahan hijab satin sangat baik dan berkualitas. Terlihat mengilap dan lembut, serta ringan saat disentuh. Ketika dikenakan hijab ini nyaman dan tak membuat rasa panas. Untuk kamu yang suka dengan tampilan berbeda, andalkan saja hijab satin ini yang cocok untuk gaya kasual hingga kondangan.",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/b9ec3e70e56c34c97cc578bc2f027fe2.jpeg"
},
{
"title": "Pashmina Ceruti Starp",
"price": 50000,
"description": "Pashmina Ceruty strap Pasmina Babydoll Ceruty hijab pasmina strap\r\nkarakteristik bahan :\r\n- Lentur/jatuh kebawah sehingga mudah dibentuk.\r\n- Tekstur ringan, halus dan lembut. nyaman untuk dipakai sehari hari.\r\n- Tidak mudah kusut.\r\n\r\nMaterial = Babydoll ceruty\r\nSize = 175 x 75 cm\r\nEdge = neat sewing\r\n\r\nWeight = 120 grams\r\n",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/9b7d781d5c2c1bbb73ba7d5615b7677f.jpeg"
},
{
"title": "Hijab Simple Fat Serration",
"price": 35000,
"description": "Khimar simple pet serration / instant veil pet simple serration\r\n\r\nMaterial = Wolvis grade A\r\n\r\nsuper neat stitching >> other colors are still in production process\r\n\r\nWeight = 155 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/00277781e24c7552d21411b3deef11d8.jpeg"
},
{
"title": "Pahsmina Baby Doll",
"price": 35000,
"description": "Pashmina baby doll ruffle Pashmina ceruty rempel pasmina sabyan kriwil\r\n\r\nMaterial = Ceruty\r\nSize = 75 x 175 cm\r\nEdge = neat sewing\r\n\r\nWeight = 130 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/dd1a41504bf4279a80a1c83922329401-600x600.jpeg"
},
{
"title": "Hijab Quadril Syar'i",
"price": 44000,
"description": "Hijab Quadril Syar'i Diamond Hijab Quadrilateral\r\n\r\nIngredients = Italiano Diamond\r\n\r\nSize = 145 x 145 cm\r\n\r\nEdges = boutique-style sewing edges\r\n\r\nWeight = 210 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/87fcc99a88694bbdcf36841e7671a5cd.jpeg"
}
]
]
}
]

<div *ngFor="let i of myjson">
<h2>support: {{i.support}}</h2>
<div *ngFor="let item of support?.items[0]">
<p>title: {{ item.title }}</p>
<p>price: {{ item.price }}</p>
<p>description: {{ item.description }}</p>
<img [src]="item.image" />
</div>
</div>

Related

How to show compact style input Choice set options(radio buttons) in single line?

I am using adaptive card version 1.2.6 for MS Teams bot integration. As per my UI Requirements, I need to display compact style choice set options in a single line. But adaptive card designers displaying horizontally. Is it possible to show options in a single line(vertically)?
Design JSON:
{
"spacing": "Small",
"id": "leave_duration",
"placeholder": "Leave Duration",
"type": "Input.ChoiceSet",
"style": "expanded",
"isMultiSelect": true,
"choices": [
{
"title": "First Half",
"value": "First Half"
},
{
"title": "Second Half",
"value": "Second Half"
},
{
"title": "Full Day",
"value": "Full Day"
}
],
"separator": true
}

Getting separate street number and street name from Foursquare search api?

I'm using the Foursquare's venue search API and everything is working as expected. But the response does not contain separate fields for street number and street address. It contains one field named "address" that contains both, like the example below
"location": {
"address": "180 Orchard St",
"crossStreet": "btwn Houston & Stanton St",
"lat": 40.72173744277209,
"lng": -73.98800687282996,
"labeledLatLngs": [
{
"label": "display",
"lat": 40.72173744277209,
"lng": -73.98800687282996
}
],
"distance": 8,
"postalCode": "10002",
"cc": "US",
"city": "New York",
"state": "NY",
"country": "United States",
"formattedAddress": [
"180 Orchard St (btwn Houston & Stanton St)",
"New York, NY 10002",
"United States"
]
I need to have the street number and street name separately. Is there anyway to get a response that has them separated? or the only way is for me to parse it?

How would I call the data in this object?

I am new to web development and am about half way through a full-stack web development course. How would I go about calling the value of the data stored with the source: "Rotten Tomatoes"?
I have tried Ratings[1].Value and it does not seem to work.
var movieObject = JSON.parse(body);
console.log('Rotten Tomatoes Rating: ', movieObject.Ratings[1].Value);
Body Content:
{
"Title": "Avatar",
"Year": "2009",
"Rated": "PG-13",
"Released": "18 Dec 2009",
"Runtime": "162 min",
"Genre": "Action, Adventure, Fantasy",
"Director": "James Cameron",
"Writer": "James Cameron",
"Actors": "Sam Worthington, Zoe Saldana, Sigourney Weaver, Stephen Lang",
"Plot": "A paraplegic marine dispatched to the moon Pandora on a unique mission becomes torn between following his orders and protecting the world he feels is his home.",
"Language": "English, Spanish",
"Country": "UK, USA",
"Awards": "Won 3 Oscars. Another 85 wins & 128 nominations.",
"Poster": "https://images-na.ssl-images-amazon.com/images/M/MV5BMTYwOTEwNjAzMl5BMl5BanBnXkFtZTcwODc5MTUwMw##._V1_SX300.jpg",
"Ratings": [
{
"Source": "Internet Movie Database",
"Value": "7.8/10"
},
{
"Source": "Rotten Tomatoes",
"Value": "83%"
},
{
"Source": "Metacritic",
"Value": "83/100"
}
],
"Metascore": "83",
"imdbRating": "7.8",
"imdbVotes": "967,488",
"imdbID": "tt0499549",
"Type": "movie",
"DVD": "22 Apr 2010",
"BoxOffice": "$749,700,000",
"Production": "20th Century Fox",
"Website": "http://www.avatarmovie.com/",
"Response": "True"
}
Your call is correct, so it must be something in the setup. Best guess is that you're calling JSON.parse() on an object that has already been converted to an object.

NetSuite data import with country code?

Question for the NetSuite experts:
Before my time, my current company decided to move to NetSuite. I'm being asked to retrieve customer data from our in-house SaaS and reformat it for import to NetSuite. Our NetSuite consultant says the customer import feature requires us to specify country by country name -- and, of course, NetSuite's built-in list of country names differs from our internal list which some developer pulled long ago from ISO 3166.
We asked the consultant why NetSuite doesn't import based upon two-letter ISO 3166 country code. He shrugged.
So, NetSuite experts, why doesn't Oracle allow for importing of customer data with two-letter ISO 3166 country code?
That's how system Architectured.
The only way is to use country enumerations table for lookup and replace codes with country names.
Ref: https://netsuite.custhelp.com/app/answers/detail/a_id/10888
For those of you who are hit by a password wall:
COUNTRY_MAPPINGS = {
"Afghanistan": "AF",
"Aland Islands": "AX",
"Albania": "AL",
"Algeria": "DZ",
"American Samoa": "AS",
"Andorra": "AD",
"Angola": "AO",
"Anguilla": "AI",
"Antarctica": "AQ",
"Antigua and Barbuda": "AG",
"Argentina": "AR",
"Armenia": "AM",
"Aruba": "AW",
"Australia": "AU",
"Austria": "AT",
"Azerbaijan": "AZ",
"Bahamas": "BS",
"Bahrain": "BH",
"Bangladesh": "BD",
"Barbados": "BB",
"Belarus": "BY",
"Belgium": "BE",
"Belize": "BZ",
"Benin": "BJ",
"Bermuda": "BM",
"Bhutan": "BT",
"Bolivia": "BO",
"Bonaire, Saint Eustatius, and Saba": "BQ",
"Bosnia and Herzegovina": "BA",
"Botswana": "BW",
"Bouvet Island": "BV",
"Brazil": "BR",
"British Indian Ocean Territory": "IO",
"Brunei Darussalam": "BN",
"Bulgaria": "BG",
"Burkina Faso": "BF",
"Burundi": "BI",
"Cambodia": "KH",
"Cameroon": "CM",
"Canada": "CA",
"Canary Islands": "IC",
"Cape Verde": "CV",
"Cayman Islands": "KY",
"Central African Republic": "CF",
"Ceuta and Melilla": "EA",
"Chad": "TD",
"Chile": "CL",
"China": "CN",
"Christmas Island": "CX",
"Cocos (Keeling) Islands": "CC",
"Colombia": "CO",
"Comoros": "KM",
"Congo, Democratic People's Republic": "CD",
"Congo, Republic of": "CG",
"Cook Islands": "CK",
"Costa Rica": "CR",
"Cote d'Ivoire": "CI",
"Croatia/Hrvatska": "HR",
"Cuba": "CU",
"Curacao": "CW",
"Cyprus": "CY",
"Czech Republic": "CZ",
"Denmark": "DK",
"Djibouti": "DJ",
"Dominica": "DM",
"Dominican Republic": "DO",
"East Timor": "TL",
"Ecuador": "EC",
"Egypt": "EG",
"El Salvador": "SV",
"Equatorial Guinea": "GQ",
"Eritrea": "ER",
"Estonia": "EE",
"Ethiopia": "ET",
"Falkland Islands": "FK",
"Faroe Islands": "FO",
"Fiji": "FJ",
"Finland": "FI",
"France": "FR",
"French Guiana": "GF",
"French Polynesia": "PF",
"French Southern Territories": "TF",
"Gabon": "GA",
"Gambia": "GM",
"Georgia": "GE",
"Germany": "DE",
"Ghana": "GH",
"Gibraltar": "GI",
"Greece": "GR",
"Greenland": "GL",
"Grenada": "GD",
"Guadeloupe": "GP",
"Guam": "GU",
"Guatemala": "GT",
"Guernsey": "GG",
"Guinea": "GN",
"Guinea-Bissau": "GW",
"Guyana": "GY",
"Haiti": "HT",
"Heard and McDonald Islands": "HM",
"Holy See (City Vatican State)": "VA",
"Honduras": "HN",
"Hong Kong": "HK",
"Hungary": "HU",
"Iceland": "IS",
"India": "IN",
"Indonesia": "ID",
"Iran (Islamic Republic of)": "IR",
"Iraq": "IQ",
"Ireland": "IE",
"Isle of Man": "IM",
"Israel": "IL",
"Italy": "IT",
"Jamaica": "JM",
"Japan": "JP",
"Jersey": "JE",
"Jordan": "JO",
"Kazakhstan": "KZ",
"Kenya": "KE",
"Kiribati": "KI",
"Korea, Democratic People's Republic": "KP",
"Korea, Republic of": "KR",
"Kosovo": "XK",
"Kuwait": "KW",
"Kyrgyzstan": "KG",
"Lao, People's Democratic Republic": "LA",
"Latvia": "LV",
"Lebanon": "LB",
"Lesotho": "LS",
"Liberia": "LR",
"Libya": "LY",
"Liechtenstein": "LI",
"Lithuania": "LT",
"Luxembourg": "LU",
"Macau": "MO",
"Macedonia": "MK",
"Madagascar": "MG",
"Malawi": "MW",
"Malaysia": "MY",
"Maldives": "MV",
"Mali": "ML",
"Malta": "MT",
"Marshall Islands": "MH",
"Martinique": "MQ",
"Mauritania": "MR",
"Mauritius": "MU",
"Mayotte": "YT",
"Mexico": "MX",
"Micronesia, Federal State of": "FM",
"Moldova, Republic of": "MD",
"Monaco": "MC",
"Mongolia": "MN",
"Montenegro": "ME",
"Montserrat": "MS",
"Morocco": "MA",
"Mozambique": "MZ",
"Myanmar": "MM",
"Namibia": "NA",
"Nauru": "NR",
"Nepal": "NP",
"Netherlands": "NL",
"New Caledonia": "NC",
"New Zealand": "NZ",
"Nicaragua": "NI",
"Niger": "NE",
"Nigeria": "NG",
"Niue": "NU",
"Norfolk Island": "NF",
"Northern Mariana Islands": "MP",
"Norway": "NO",
"Oman": "OM",
"Pakistan": "PK",
"Palau": "PW",
"Panama": "PA",
"Papua New Guinea": "PG",
"Paraguay": "PY",
"Peru": "PE",
"Philippines": "PH",
"Pitcairn Island": "PN",
"Poland": "PL",
"Portugal": "PT",
"Puerto Rico": "PR",
"Qatar": "QA",
"Reunion Island": "RE",
"Romania": "RO",
"Russian Federation": "RU",
"Rwanda": "RW",
"Saint Barthélemy": "BL",
"Saint Helena": "SH",
"Saint Kitts and Nevis": "KN",
"Saint Lucia": "LC",
"Saint Martin": "MF",
"Saint Vincent and the Grenadines": "VC",
"Samoa": "WS",
"San Marino": "SM",
"Sao Tome and Principe": "ST",
"Saudi Arabia": "SA",
"Senegal": "SN",
"Serbia": "RS",
"Seychelles": "SC",
"Sierra Leone": "SL",
"Singapore": "SG",
"Sint Maarten": "SX",
"Slovak Republic": "SK",
"Slovenia": "SI",
"Solomon Islands": "SB",
"Somalia": "SO",
"South Africa": "ZA",
"South Georgia": "GS",
"South Sudan": "SS",
"Spain": "ES",
"Sri Lanka": "LK",
"State of Palestine": "PS",
"St. Pierre and Miquelon": "PM",
"Sudan": "SD",
"Suriname": "SR",
"Svalbard and Jan Mayen Islands": "SJ",
"Swaziland": "SZ",
"Sweden": "SE",
"Switzerland": "CH",
"Syrian Arab Republic": "SY",
"Taiwan": "TW",
"Tajikistan": "TJ",
"Tanzania": "TZ",
"Thailand": "TH",
"Togo": "TG",
"Tokelau": "TK",
"Tonga": "TO",
"Trinidad and Tobago": "TT",
"Tunisia": "TN",
"Turkey": "TR",
"Turkmenistan": "TM",
"Turks and Caicos Islands": "TC",
"Tuvalu": "TV",
"Uganda": "UG",
"Ukraine": "UA",
"United Arab Emirates": "AE",
"United Kingdom": "GB",
"United States": "US",
"Uruguay": "UY",
"US Minor Outlying Islands": "UM",
"Uzbekistan": "UZ",
"Vanuatu": "VU",
"Venezuela": "VE",
"Vietnam": "VN",
"Virgin Islands, British": "VG",
"Virgin Islands, USA": "VI",
"Wallis and Futuna Islands": "WF",
"Western Sahara": "EH",
"Yemen": "YE",
"Zambia": "ZM",
"Zimbabwe": "ZW"
}

Update inner object in arangodb

I have an object stored in arangodb which has additional inner objects, my current use case requires that I update just one of the elements.
Store Object
{
"status": "Active",
"physicalCode": "99999",
"postalCode": "999999",
"tradingCurrency": "USD",
"taxRate": "14",
"priceVatInclusive": "No",
"type": "eCommerce",
"name": "John and Sons inc",
"description": "John and Sons inc",
"createdDate": "2015-05-25T11:04:14+0200",
"modifiedDate": "2015-05-25T11:04:14+0200",
"physicalAddress": "Corner moon and space 9 station",
"postalAddress": "PO Box 44757553",
"physicalCountry": "Mars Sector 9",
"postalCountry": "Mars Sector 9",
"createdBy": "john.doe",
"modifiedBy": "john.doe",
"users": [
{
"id": "577458630580",
"username": "john.doe"
}
],
"products": [
{
"sellingPrice": "95.00",
"inStock": "10",
"name": "School Shirt Green",
"code": "SKITO2939999995",
"warehouseId": "723468998682"
},
{
"sellingPrice": "95.00",
"inStock": "5",
"name": "School Shirt Red",
"code": "SKITO245454949495",
"warehouseId": "723468998682"
},
{
"sellingPrice": "95.00",
"inStock": "10",
"discount": "5%",
"name": "School Shirt Blue",
"code": "SKITO293949495",
"warehouseId": "723468998682"
}
]
}
I want to change just one of the products stock value
{
"sellingPrice": "95.00",
"inStock": "10",
"discount": "5%",
"name": "School Shirt Blue",
"code": "SKITO293949495",
"warehouseId": "723468998682"
}
Like update store product stock less 1 where store id = x, something to this effect
FOR store IN stores
FILTER store._key == "837108415472"
FOR product IN store.products
FILTER product.code == "SKITO293949495"
UPDATE product WITH { inStock: (product.inStock - 1) } IN store.products
Apart from the above possibly it makes sense to store product as a separate document in collection store_products. I believe in NOSQL that is the best approach to reduce document size.
Found answer
here arangodb-aql-update-single-object-in-embedded-array and there
arangodb-aql-update-for-internal-field-of-object
I however believe it is best to maintain separate documents and rather use joins when retrieving. Updates easily

Resources