Removing a object property using delete doesn't seem to work with angular.
The object remains unchanged.
The weird thing is that I can add properties to the object just fine.
Could it be because the object is exposed in $scope ? But how can I remove properties from it then?
This is my code
const {remote} = require('electron');
angular.module('myapp', []).service('db', function(){
var data = remote.getGlobal('data');
return {
removeItem: function(item){
console.log(delete data[item]); -> returns false!!
}
}
});
I'm calling the method from a controller:
$scope.removeAction = function(item){
db.removeItem(item);
};
removeAction is called on ng-click of a button