I'm trying to add new value into existing JSON object in AngularJS but I'm getting this error message:
"Object doesn't support property or method 'push'"
Here is my code:
$scope.addStatus = function (text) {
$scope.application.push({ 'status': text }); //I have tried 'put' but getting the error
};
$scope.create = function( application ){
$scope.addStatus('Under review');
}
here is my application json looks like:
{"type":"Not completed","source":"mail","number":"123-23-4231","amount":"234.44","name":"John ","id":"123","by_phone":true}
I want to append/add status to the above json and something looks like after adding the status property:
{"type":"Not completed","source":"mail","number":"123-23-4231","amount":"234.44","name":"John ","id":"123","by_phone":true, "status": "under review"}