I want to convert a string to and Object and below is my code
$scope.myString = "{'profit': 2.276273727416992}";
$scope.result = angular.toJson($scope.myString);
console.log('is object = ' + angular.isObject($scope.result)); // false
I'm using angular.toJson() for conversion to but its not working out.
Please let me know what is wrong here and how can I convert