2017-04-03 5 views
0

私はデータ辞書という概念を使って値を取得しようとしていましたが、どのように正しい構文が書かれているのか混乱しています。角度のデータ辞書概念の構文は正しいかどうか?

$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": "[email protected]", 
 
      "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": "[email protected]", 
 
      "phoneno": "+91-7829439347", 
 
      "postcode": "560094", 
 
      "upgrade": "Upgrade-membershilp" 
 
     }, 
 
    };

いずれはそれが正しいかではないと言います。

答えて

0

これは正しいですが、これはjavascriptの概念です。 Javascriptオブジェクトはキーと値のペア(辞書)です。キーの引用符は"id" : "2"ではなく、オプションのid: "2"であることに注意してください。

+0

ご協力ありがとうございます – Sneha

関連する問題