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.

4
  • 1
    Add more code or a jsfiddle to help you out there. Commented Feb 22, 2016 at 20:48
  • Possible duplicate of AngularJS How to remove an Item from scope Commented Feb 22, 2016 at 20:54
  • Don't know what you're talking about: jsfiddle.net/yvbenitah/Lvc0u55v/42 Commented Feb 22, 2016 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 Commented Feb 22, 2016 at 21:01

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.