Here's the way that you can delete any property name from the object of scope. This method require using Underscore.js library.
index.html
//Underscore.js must be imported
<script src="path/to/underscore/underscore-min.js"></script>
//Replace prop with any property name
<button ng-click="removeMyProperty(object, 'prop')">Test</button>
Controller
$scope.object = {"prop": "test", "anotherProp" : 10};
$scope.removeMyProperty = function(variable, propName){
var keys = _.keys(variable);
_.each(keys, function(data){
if(data === propName){
$scope.object = _.omit(variable, propName);
}
else {
console.log("No such property name in array!");
}
});
};
This works only when you use Underscore.js library and thus you must add it to your project classpath and import underscore.js file in index.html
If you are not familiar with Underscore, please go here Underscore.js