0

I am doing following on a call back.

$scope.summary = data;

Once summary object is part of $scope i cant delete it programatically on another event like following.

delete $scope.summary

Above line returns true but the object is still there with all data. Btw if I do the following it deletes the object successfully.

delete $scope.summary.abc

It would be great if you can shed light on this and guide me through this.

AMBasra
  • 969
  • 8
  • 24
  • 1
    Add more code or a jsfiddle to help you out there. – Develobba Feb 22 '16 at 20:48
  • Possible duplicate of [AngularJS How to remove an Item from scope](http://stackoverflow.com/questions/14250642/angularjs-how-to-remove-an-item-from-scope) – LJ.Wizard Feb 22 '16 at 20:54
  • Don't know what you're talking about: http://jsfiddle.net/yvbenitah/Lvc0u55v/42/ – IsraGab Feb 22 '16 at 20:54
  • The snippet you show should work but, why do you want to delete a variable instead of assigning `null` or `undefined` to it? I'm curious – jbmartinez Feb 22 '16 at 21:01

1 Answers1

0

Are you deleting the property "Summary" in the right $scope?

There is possibility you want to delete "summary" property of the $parent $scope. Without some code it is hard to tell.

Valter
  • 2,859
  • 5
  • 30
  • 51