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
  • 11,349
  • 20
  • 53
  • 64

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
  • 679
  • 5
  • 15