angular.Object.equals

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. During property comparision properties of function type and properties with name starting with $ are ignored.

Supports values types, arrays and objects.

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

Dependencies

Usage

angular.Object.equals(o1, o2);

Parameters

Returns

{boolean}

True if arguments are equal.

Example

Salutation: <input type="text" name="greeting.salutation" value="Hello" /><br/> Name: <input type="text" name="greeting.name" value="world"/><br/> <hr/> The <code>greeting</code> object is <span ng:hide="greeting.$equals({salutation:'Hello', name:'world'})">NOT</span> equal to <code>{salutation:'Hello', name:'world'}</code>. <pre>greeting={{greeting}}</pre>