angular.Object.equals

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

Description

Determines if two objects or value are equivalent.

To be equivalent, they must pass == comparison or be of the same type and have all their properties pass == comparison.

Supports values types, arrays and objects.

For objects function properties and properties that start with $ are not considered during comparisons.

Note: this function is used to augment the Object type in angular expressions. See angular.Object for more info.

Usage

angular.Object.equals(o1, o2);

Parameters

Returns

boolean – True if arguments are equal.

Example

Salutation: <input type="text" name="master.salutation" value="Hello" /><br/> Name: <input type="text" name="master.name" value="world"/><br/> <button ng:click="form = master.$copy()">copy</button> <hr/> Master is <span ng:hide="master.$equals(form)">NOT</span> same as form. <pre>master={{master}}</pre> <pre>form={{form}}</pre>