i am getting a json in return whose value is &<>" and many more special character.I want a common solution to convert all of them into their actual values like & as &," into ",,etc. I dont want to use anthing like the below code because in future more different symbols can come-
$scope.oldNotification[i].shorttext=$scope.oldNotification[i].shorttext.replace(/&/g, '&');
$scope.oldNotification[i].shorttext=$scope.oldNotification[i].shorttext.replace(/</g, '<');
$scope.oldNotification[i].shorttext=$scope.oldNotification[i].shorttext.replace(/>/g, '>');
$scope.oldNotification[i].shorttext=$scope.oldNotification[i].shorttext.replace(/"/g, '"');
$scope.oldNotification[i].shorttext=$scope.oldNotification[i].shorttext.replace(/'/g, "'");
Is there any api to handle these value and convert them into their actual value? I am using angularJs.