1

I'm using AngularJS to code an app's front end, which consumes and store data from Backendless.

So far so good, the thing is that when I try to store changes I get errors because $$hashKey property added by AngularJS.

To make a long story short, my problem is that if I get an object from Backendless, I make changes on it with AngularJS and then I try to save the modified object, Backendless API seems to expect an object with same attributes, and since AngularJS adds stuff such as $$hashKey, I get the errors.

So, my question is, how do I get rid of $$hashKey ?,

I've read similar questions here but:

  1. I'm not dealing with JSON objects, so unless I can convert to json to clean attributes and then 'build' the object again, this approach is not very useful.
  2. They're not considering nested objects, i.e. removing attributes from attribute objects
  3. The answers don't consider making a deep copy before making any changes and then update such a copy before saving, which is an alternative I'm considering but I'm not quite sure if it's the best one.

Any hint or comment is very appreciated.

Thank you in advance.

RobertoAllende
  • 8,744
  • 4
  • 30
  • 49
  • 1
    Have you tried to use the native methods like https://docs.angularjs.org/api/ng/function/angular.toJson? – developer033 Jul 08 '16 at 03:14
  • 1
    There is a similar discussion at: There is a similar discussion at: http://stackoverflow.com/questions/18826320/what-is-the-hashkey-added-to-my-json-stringify-result – Mark Piller Jul 08 '16 at 13:28

0 Answers0