Anthony
Anthony

Reputation: 1827

Can I add properties to an object in the Chrome debugger?

I know I can edit values or properties on an object in the Chrome debugger, but is there a way to add properties?

Edit: Here's an example of what I mean. In this popup window I can edit that values of these properties on this object. Is there a way I can add new properties to this object?

enter image description here

Upvotes: 5

Views: 4448

Answers (1)

tristansokol
tristansokol

Reputation: 4271

For the example in your image, if you were stopped in debugging mode all you would have to do is enter something like $scope.newProp = 'value'; into the console. The object will now have a new property while you continue to debug your program.

Upvotes: 6

Related Questions