AngularJS versus $$ hashkey

I am trying to compare an object included in a relay to an object just returned from the server.

Because the repeating object contains the hashkey property, angular.equals evaluates to false.

I think I could just remove the property, but I don't know if this is an angular way to do this.

thanks

+5
source share
1 answer

There is an angular way to handle this. You need to track the unique field that each object has. For example, instead of:

item in items 

do:

 item in items track by item.id 

Checkout angular documentation regarding ngRepeat and $$ hasKey

+6
source

Source: https://habr.com/ru/post/1216551/


All Articles