While I may be proficient in utilizing existing data, my expertise in editing JSON objects is not quite up to par yet. Any assistance in this area would be greatly appreciated. This question may seem basic, but I am seeking clarification as I am unsure.
How can I update a value in a JSON string that resembles the structure below? It pertains to a kineticjs object that requires draggable elements to be disabled before the stage is regenerated.
I have attempted to create a fiddle based on some suggestions provided, but so far, I have not been successful. Here is the link to the fiddle: http://jsfiddle.net/8Y6zZ/5/
For instance, I aim to change "draggable": true,
to "draggable": false,
wherever it occurs... How can this be achieved using javascript (specifically within angularjs)?
{
"attrs": {
"width": 1276,
"height": 660
},
"className": "Stage",
"children": [
{
"attrs": {},
"className": "Layer",
"children": [
{
"attrs": {
"x": 0,
"y": 0,
"draggable": false,
"name": "brochure-1.png"
},
"className": "Image"
},
{
"attrs": {
"x": 999,
"y": 288,
"draggable": true,
"name": "sample1.png",
"rotation": 0,
"scaleX": 1,
"scaleY": 1,
"offsetX": 0,
"offsetY": 0,
"skewX": 0,
"skewY": 0
},
"className": "Image"
},
{
"attrs": {
"x": 301,
"y": 115,
"draggable": true,
"name": "sample2.png",
"rotation": 0,
"scaleX": 1,
"scaleY": 1,
"offsetX": 0,
"offsetY": 0,
"skewX": 0,
"skewY": 0
},
"className": "Image"
}
]
}
]
}
In connection to this query, are there effective methods to reconstruct JSON objects from a "basic" JSON format? Essentially, if a backend developer provides poorly organized JSON data, is there a way to restructure the object for efficient use within angularjs?