0

How can i make a long string into a key value pair? My JSON object is:

column = {
  "column_Name": "id",
  "table_Name": "calls",
  "full_Column_Name": "calls.id",
  "checked": false
}

And I want:

$scope.x = {
  column_Name: "id",
  table_Name: "calls",
  full_Column_Name: "calls.id",
  checked: false
}
Owen Pauling
  • 10,718
  • 19
  • 51
  • 60

1 Answers1

0

To convert a JSON string to a javascript object you can;

$scope.x = JSON.parse(column);

More information here

Community
  • 1
  • 1
Tom Johnson
  • 659
  • 5
  • 15