1

I am getting the response as mentioned below:

AFMomFormDetails now has {\"sigName\":\"qwer\",\"contName\":\"asdf\",\"signature\":\"zxcv\"} after the move

var resStr = response;
var retStr = resStr.substring(resStr.indexOf("{"), resStr.indexOf("}")+1);
var strObj  = retStr.replace(/\\/g, "");
$scope.fdetails=JSON.stringify(strObj);

I am unable to bind the values in angularjs. Can anyone please help me?

Samson Maben
  • 310
  • 2
  • 4
  • 15
Moulali
  • 465
  • 1
  • 6
  • 17

1 Answers1

1

You are getting a json string, try parsing it with JSON.parse(), it will give you an object. Then bind this object to $scope.fdetails.

var resStr = '{\"sigName\":\"qwer\",\"contName\":\"asdf\",\"signature\":\"zxcv\"}';
var obj = JSON.parse(resStr)
console.log(obj);
Hassan Imam
  • 21,956
  • 5
  • 41
  • 51