How to compare two objects in Angular not using reference of object
angular, typescript
Solution
If you need to do more comparisons like this one on your project, I highly recommend you using library like deep-equal:
https://www.npmjs.com/package/deep-equal
It has their types to be used with TypeScript:
https://www.npmjs.com/package/@types/deep-equal
Problem
how typescript comparing two objects? ``` originaltraits:{ artistic:25, athletic:24, goodLooks:70, happiness:0, health:81 } newtraits:{ artistic:25, athletic:24, goodLooks:70, happiness:0, health:81 } ``` I have these two objects I want to compare these objects' fields not using object reference in Angular then how to compare? Why does two equal Objects shows 'not equal" in Angular 2