Get json data in controller and use data as vars and functions etc

I am pretty new to Angular JS and I am currently building an order form where a user can use a form to graphically build their item. I have a json file, which lists all elements of the products (frame, background, letters, message) and their SKU’s and prices. I can get the json in to the app as ‘products’ but i’d like to be able to get this data as per the users selection, i.e if the user chooses the gold frame, i’d like to make a variable which includes the SKU, price and weight of the gold frame from the json. Hope that makes sense.

There is a demo located at https://jsfiddle.net/3kd796wL/ and this is my json file:

{
  "products":
    {
      "frames": {
        "plastic": {
          "SKU": "PLA",
          "price": 1.00,
          "weight": 1.00
        },
        "wood": {
          "SKU": "WOO",
          "price": 6.00,
          "weight": 3.00
        },
        "silver": {
          "SKU": "SIL",
          "price": 12.00,
          "weight": 6.00
        },
        "gold": {
          "SKU": "GOL",
          "price": 18.00,
          "weight": 12.00
        }
      },
      "backgrounds":{
        "feet":{
          "SKU": "BK01",
          "price": 1.00,
          "weight": 0
        },
        "flowers":{
          "SKU": "BK02",
          "price": 1.00,
          "weight": 0
        },
        "rabbits":{
          "SKU": "BK01",
          "price": 1.00,
          "weight": 0
        }
      }
    }
}

Any help is appreciated. Thanks!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.