After a manipultion of a JSON object i have a string like:
[{ContextID:'7',Title:'Rona',TypeId:'1',Children:[{ContextID:'8',Title:'Site internet',TypeId:'2',Children:'null'},{ContextID:'9',Title:'Magasins',TypeId:'2',Children:[{ContextID:'10',Title:'RONA Quincaillerie Delorimier Inc.',TypeId:'4',Children:[{ContextID:'11',Title:'Caisse',TypeId:'3',Children:[{ContextID:'12',Title:'Retour marchandise',TypeId:'3',Children:'null'}]}]}]}]
I want to transform it an array in javascript to pass it to angularjs-ui-tree
like this one. I have tried JSON.parse()
but it doesn't work
[{ContextID:'7',Title:'Rona',TypeId:'1',Children:[{ContextID:'8',Title:'Site internet',TypeId:'2',Children:'null'},{ContextID:'9',Title:'Magasins',TypeId:'2',Children:[{ContextID:'10',Title:'RONA Quincaillerie Delorimier Inc.',TypeId:'4',Children:[{ContextID:'11',Title:'Caisse',TypeId:'3',Children:[{ContextID:'12',Title:'Retour marchandise',TypeId:'3',Children:'null'}]}]}]}]