javascript - Getting issue to convert in JSON object -
this question has answer here:
- safely turning json string object 20 answers
i getting response mentioned below:
afmomformdetails has {\"signame\":\"qwer\",\"contname\":\"asdf\",\"signature\":\"zxcv\"}
after move
var resstr = response; var retstr = resstr.substring(resstr.indexof("{"), resstr.indexof("}")+1); var strobj = retstr.replace(/\\/g, ""); $scope.fdetails=json.stringify(strobj);
i unable bind values in angularjs. can please me?
you getting json string, try parsing json.parse()
, give object. bind object $scope.fdetails
.
var resstr = '{\"signame\":\"qwer\",\"contname\":\"asdf\",\"signature\":\"zxcv\"}'; var obj = json.parse(resstr) console.log(obj);
Comments
Post a Comment