我试图通过使用data-dictionary概念来获得值,但我很困惑如何将它写下来,它的正确语法是什么。
$scope.listDetails = {
"venue-1": {
"id": "1",
"venue": "venue-1",
"membershiptype": "RG11EP",
"AbsoluteImageUrl": "http://www.sporta.co.il/include/items/102.jpg",
"ImageFileName": "102.jpg",
"address": "Golds Gym,Kalyannagar",
"AbsoluteImageUrl1": "https://amidtheimaginary.files.wordpress.com/2015/03/3-star-rating.jpg",
"ImageFileName1": "3-star-rating.jpg",
"description": "Gold’s Gym started in Venice California in 1965, and soon became the hotbed for the development of training techniques, equipment and nutritional concepts that formed the foundation for the modern fitness revolution.",
"email": "goldsgym.123@gmail.com",
"phoneno": "+91-7829439349",
"postcode": "560043",
"upgrade": "Upgrade-membershilp"
},
"venue-2": {
"id": "2",
"venue": "venue-2",
"membershiptype": "RG11ER",
"AbsoluteImageUrl": "http://www.sporta.co.il/include/items/102.jpg",
"ImageFileName": "102.jpg",
"address": "Dance School,hebbal",
"AbsoluteImageUrl1": "https://amidtheimaginary.files.wordpress.com/2015/03/3-star-rating.jpg",
"ImageFileName1": "3-star-rating.jpg",
"description": "This dance shool is really nice.You will definitly like it.",
"email": "danceshool@gmail.com",
"phoneno": "+91-7829439347",
"postcode": "560094",
"upgrade": "Upgrade-membershilp"
},
};
任何人只要说正确与否就行了。
发布于 2017-04-03 12:58:12
这是正确的,但这是一个javascript的概念。Javascript对象是键值对(字典)。请注意,键上的引号是可选的id: "2",而不是"id" : "2"。
https://stackoverflow.com/questions/43185163
复制相似问题