0

Once i rendered data from backend i want to remove element id from the array how can i achieve that using angularjs ?

ctrl.js

$scope.array =  [{
        "name": "Java Class",
        "id": "javaClass",
        "createdBy": "shu",
        "__v": 0,
        "properties": [{
            "label": "Java Package Name",
            "type": "String",
            "editable": true,
            "binding": {
                "type": "property",
                "name": "camunda:class"
            }
        }],
        "appliesTo": ["bpmn:ServiceTask"]
    }]
baao
  • 71,625
  • 17
  • 143
  • 203
hussain
  • 6,587
  • 18
  • 79
  • 152
  • 1
    Possible duplicate of [How to remove elements/nodes from angular.js array](http://stackoverflow.com/questions/18303040/how-to-remove-elements-nodes-from-angular-js-array) – phemt.latd Feb 09 '17 at 18:17
  • The element at index `0` of `$scope.array` is an object, not an array. – guest271314 Feb 09 '17 at 18:21
  • @phemt.latd OP is attempting to remove a property from an object, not an element from an array. – guest271314 Feb 09 '17 at 18:22

1 Answers1

2

You can use delete

delete $scope.array[0].id;
guest271314
  • 1
  • 15
  • 104
  • 177